4

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.

1
  • If user3054250's answer does not help, could you share more about your setup? E.g., did you package your code as a module and put it into mods? Commented Mar 19, 2016 at 6:41

1 Answer 1

2

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

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

Sign up to request clarification or add additional context in comments.

1 Comment

The answer works on Windows. For example, I used “C:\Program Files\Java\jdk-9\bin”\java --module-path mods -m com.greetings/com.greetings.Main on Winows.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.