trying jigsaw-ea-95 jlink

Sebastian Sickelmann sebastian.sickelmann at
Sat Dec 12 18:40:50 UTC 2015

I am sorry i haven't tried it before.

It works if i create jmods files with the jmod tool before i use jlink
to create the distribution.
Is is normal, that it doen't work with exploded modules on the filesystem?
Or is it a bug, or missing feature?


On 12/12/2015 06:47 PM, Sebastian Sickelmann 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 at Inspi:~/example1$ ~/jigsaw-ea-95/bin/java -mp mymods -m
> <output-of-programm>
> The mymods directory has the following structure
> sebastian at Inspi:~/example1$ du --si mymods
> 8.2k    mymods/
> 13k    mymods/
> 21k    mymods/
> 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
> and declare mymods and the jmod dir as modulepath
> sebastian at Inspi:~/example1$ ~/jigsaw-ea-95/bin/jlink --modulepath
> mymods:/home/sebastian/jigsaw-ea-95/jmods --addmods --output
> jlink-ea
> I can list the modules that are included in the resulting distribution
> sebastian at Inspi:~/example1$ jlink-ea/bin/java -listmods
> demo.lib
> java.base at 9-ea
> But I am not able to start my programm
> sebastian at Inspi:~/example1$ jlink-ea/bin/java -m
> Error: Could not find or load main class in module
> To be sure not to made a typing error i tried
> sebastian at Inspi:~/example1$ jlink-ea/bin/java -m
> Error occurred during initialization of VM
> java.lang.module.ResolutionException: Module not found
>     at at 9-ea/
>     at java.lang.module.Resolver.resolve(java.base at 9-ea/
>     at
> java.lang.module.Configuration.resolve(java.base at 9-ea/
>     at
> jdk.internal.module.ModuleBootstrap.boot(java.base at 9-ea/
>     at java.lang.System.initPhase2(java.base at 9-ea/
> 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 at Inspi:~/example1$ jlink-ea/bin/java -m
> module 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

More information about the jigsaw-dev mailing list