Application with mix of module and jars
Alan Bateman
Alan.Bateman at oracle.com
Mon Jun 20 19:20:51 UTC 2016
On 20/06/2016 19:33, vishal jain wrote:
> :
>
> Now when executing with :
>
> java -mp mlib -classpath jars -jar jars/nonmodule.jar
>
> Exception in thread "main" java.lang.NoClassDefFoundError:
> module1/Module1Class
>
> at nonmodule.NonModuleClass.sayHello(NonModuleClass.java:8)
>
> at nonmodule.NonModuleClass.main(NonModuleClass.java:14)
>
> Caused by: java.lang.ClassNotFoundException: module1.Module1Class
>
> at jdk.internal.loader.BuiltinClassLoader.loadClass(java.base at 9-ea
> /BuiltinClassLoader.java:366)
If you add `-addmods module1` to the command line then I assume it will
work. The reason you need this is because there isn't any module that
has declared a dependency on "module1". The "Root modules" section in
JEP 261 [1] has the details on the root modules to resolve at startup.
-Alan
[1] http://openjdk.java.net/jeps/261
More information about the jigsaw-dev
mailing list