Thank you Andy, for clarifying. I thought i was missing some detail. Guess, I will have to be a bit more patient. ;-)

/Tobias Oelgarte

On 25.02.19 22:20, Andy Herrick wrote:
Tobias:

After the latest fix (JDK-8217798: modular jar linking in jpackage) the following now works:

jpackage create-image --module de.asysgmbh.app.test/de.asysgmbh.app.test.Main --module-path /data/projects/javam/de.asysgmbh.app.test/target/modules ...

will work fine, but

jpackage create-image --module de.asysgmbh.app.test --main-class de.asysgmbh.app.test.Main --module-path /data/projects/javam/de.asysgmbh.app.test/target/modules ...

will not work. (actually it will build but them not run, saying: "module XXX does not have a ModuleMainClass attribute, use -m <module>/<main-class>)

In any case the latest EA does not work with modular jars, and a future version will prohibit mixing --module with --main-class options.

The help text will be re-written to clarify which options are used in which use cases.

/Andy



On 2/25/2019 3:00 PM, Tobias Oelgarte wrote:
I'm wondering how jpackage searches for modules. I tried to build a very simple example (using Build 17 of jpackage), but jpackage always claims that the module can't be found.

~$ ./jpackage create-image \
    --output /data/projects/javam/de.asysgmbh.app.test/target/image \
    --name test \
    --main-class de.asysgmbh.app.test.Main \
    --module de.asysgmbh.app.test \
    --module-path /data/projects/javam/de.asysgmbh.app.test/target/modules
~ $ Module de.asysgmbh.app.test does not exist.

The modules directory contains the file "de.asysgmbh.app.test-1.0-SNAPSHOT.jar" including the module-info.class with the module named "de.asysgmbh.app.test".

    module de.asysgmbh.app.test { ... }

The following works just fine:

~$ java \
    --module-path /data/projects/javam/de.asysgmbh.app.test/target/modules \
    --module de.asysgmbh.app.test/de.asysgmbh.app.test.Main


Reply via email to