简体   繁体   中英

How to resolve java.lang.module.ResolutionException in JDK9

I am on build 109 of JDK9 with the Jigsaw build .

I am trying a hello-world type of example just to get started with JDK9 modular development. When I launch the application, I am getting the following RuntimeException (I am providing the java launcher command as well):

C:\JDK9Tryouts\HelloWorld1>java -modulepath mods -m hello.world1\hello.world1.HelloWorld1

Error occurred during initialization of VM
java.lang.module.ResolutionException: Module hello.world1\hello.world1.HelloWorl
d1 not found
        at java.lang.module.Resolver.fail(java.base@9-ea/Resolver.java:796)
        at java.lang.module.Resolver.resolveRequires(java.base@9-ea/Resolver.jav
a:94)
        at java.lang.module.Configuration.resolveRequiresAndUses(java.base@9-ea/
Configuration.java:342)
        at jdk.internal.module.ModuleBootstrap.boot(java.base@9-ea/ModuleBootstr
ap.java:217)
        at java.lang.System.initPhase2(java.base@9-ea/System.java:1916) 

As you can see I have set the -modulepath to refer to the directory which contains user defined modules.

What should I target in order to debug this.

Looks like you have the wrong slash / , I assume you want:

java -mp mods -m hello.world1/hello.world1.HelloWorld1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM