Error occurred during initialization of boot layer FindException: Module not found

前端 未结 8 1353
庸人自扰
庸人自扰 2020-11-28 13:39

Executing a simple \"Hello World\" program using Java 9 results in the following error message:

Error occurred during initialization of boot layer

相关标签:
8条回答
  • 2020-11-28 14:19

    I had the same issue and I fixed it this way:

    1. Deleted all projects from eclipse, not from the computer.
    2. Created a new project and as soon as you write the name of your project, you get another window, in which is written: "Create module-info.java". I just clicked "don't create".
    3. Created a package. Let us call the package mywork.
    4. Created a Java class inside the package myWork. Let us call the class HelloWorld.
    5. I run the file normally and it was working fine.

    Note: First, make sure that Java is running properly using the CMD command in that way you will understand the problem is on eclipse and not on JDK.

    0 讨论(0)
  • 2020-11-28 14:20

    You say that your module-info.java contains

    module myModule {}
    

    That means it declares a module called myModule, not com.pantech.myModule. Pointing this from the command format:

     -m <module-name>/<main-class>
    
    0 讨论(0)
提交回复
热议问题