I followed the steps to create the HelloWorld example but it doesn't run. It gives the following error:
Error occurred during initialization of boot layer java.lang.module.FindException: Error reading module: F:\Develop\eclipse\HelloWorld\bin Caused by: java.lang.module.InvalidModuleDescriptorException: HelloWorld.class found in top-level directory (unnamed package not allowed in module)"
Please advise how to solve this.
The error occurs because of you add your jar library files to MODULEPATH instead of CLASSPATH. You have to add jar files to your CLASSPATH. If you already add jar files to MODLEPATH you have to remove from there and add jar files to CLASSPATH, there is the steps:
1] Right click on your project name in ECLIPSE IDE
2] Click on PROPERTIES -> JAVA BUILD PATH -> click LIBRARY tab .The you get the window like this:
3] Expand MODULEPATH and select all jar files and remove it :look the picture below:
4] After that click on CLASSPATH ->and click the button 'ADDJAR' and select the jar files ,your are done. Look the picture below for clarification;
5] After adding jars files in CLASSPATH it looks like this:
I had the same error before because I use the default package.
And I solved the problem in this way: Right-click the project - Properties - Java Build Path - move the class from Modulepath to Classpath
And it worked!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With