Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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:DevelopeclipseHelloWorldin Caused by: java.lang.module.InvalidModuleDescriptorException: HelloWorld.class found in top-level directory (unnamed package not allowed in module)"

enter image description here Please advise how to solve this.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
640 views
Welcome To Ask or Share your Answers For Others

1 Answer

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:

Java build path window

3] Expand MODULEPATH and select all jar files and remove it :look the picture below:

Modulepath jar file removing

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;

Add jar to classpaht

5] After adding jars files in CLASSPATH it looks like this:

After adding jar file to classpath


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...