Executing a simple "Hello World" program using Java 9 results in the following error message:
Error occurred during initialization of boot layer
java.lang.module.FindException: Module com.pantech.myModule not found
The command line that I executed was:
java --module-path bin -m com.pantech.myModule/com.pantech.myModule.HelloWorld
This command line is executed from the parent directory of my bin
directory that contains all of the .class
bytecode files.
The module-info.class
file is located in the com.pantech.myModule
directory that is located in the bin
directory. The HelloWorld.class
file contains the main method and is located in the package directory within the com.pantech.myModule
directory. Therefore, the pathname of the HelloWorld.class
file is bin\com.pantech.myModule\com\pantech\myModule\HelloWorld.class.
The HelloWorld
class is in the com.pantech.myModule
package (package name same as the module name).
I am using Windows 10 as the Operating System. From everything that I have read, the above command line should be correct. Any suggestions on how to fix this?
bin\com.pantech.myModule
– Bourgescom.greetings
(in the sample), hence their command works. Also, refer to docs.oracle.com/javase/9/tools/java.htm for more details on the commands used. – PunishClean and Rebuild Project
and it worked. – Karie