Sebastian, Martin, Thanks for reporting the issue. This issue has been fixed and available in the Jigsaw EA build [1].
JDK-8145775: Modules without the ConcealedPackages attribute can be linked but may not run Please let me know if you run into any other issue. Mandy [1] https://jdk9.java.net/jigsaw/ > On Dec 12, 2015, at 9:47 AM, Sebastian Sickelmann > <[email protected]> wrote: > > Hi I am trying to work with jlink, and do not get it working. What I am > doing wrong? > > My compiled modules(not jars, but exploded in the filesystem) are at the > directory mymods > I can start my programm via > sebastian@Inspi:~/example1$ ~/jigsaw-ea-95/bin/java -mp mymods -m > demo.app/demo.app.Example1 > <output-of-programm> > > The mymods directory has the following structure > sebastian@Inspi:~/example1$ du --si mymods > 8.2k mymods/demo.app/demo/app > 13k mymods/demo.app/demo > 21k mymods/demo.app > 8.2k mymods/demo.lib/demo/lib > 13k mymods/demo.lib/demo > 21k mymods/demo.lib > 46k mymods > > If i now try to create a distribution with jlink, i add my module > demo.app and declare mymods and the jmod dir as modulepath > sebastian@Inspi:~/example1$ ~/jigsaw-ea-95/bin/jlink --modulepath > mymods:/home/sebastian/jigsaw-ea-95/jmods --addmods demo.app --output > jlink-ea > > I can list the modules that are included in the resulting distribution > sebastian@Inspi:~/example1$ jlink-ea/bin/java -listmods > demo.app > demo.lib > java.base@9-ea > > But I am not able to start my programm > sebastian@Inspi:~/example1$ jlink-ea/bin/java -m demo.app/demo.app.Example1 > Error: Could not find or load main class demo.app.Example1 in module > demo.app > > To be sure not to made a typing error i tried > sebastian@Inspi:~/example1$ jlink-ea/bin/java -m > demo.app.not.existing/demo.app.Example1 > Error occurred during initialization of VM > java.lang.module.ResolutionException: Module demo.app.not.existing not found > at java.lang.module.Resolver.fail(java.base@9-ea/Resolver.java:860) > at java.lang.module.Resolver.resolve(java.base@9-ea/Resolver.java:291) > at > java.lang.module.Configuration.resolve(java.base@9-ea/Configuration.java:246) > at > jdk.internal.module.ModuleBootstrap.boot(java.base@9-ea/ModuleBootstrap.java:188) > at java.lang.System.initPhase2(java.base@9-ea/System.java:1911) > > But it seemed that I am not able to type a wrong module name. So there > is no typing error there. > > And if I just want to start my module (without a startup-class) > sebastian@Inspi:~/example1$ jlink-ea/bin/java -m demo.app > module demo.app does not have a MainClass attribute, use -m > <module>/<main-class> > > It says that java does not find the MainClass (as expected) > > What I am doing wrong? > > Thanks for your help. > > -- > Sebastian
