Eclipse - module not found when adding module-info.java

I have a simple hello world project in eclipse that I want to run with java 9. The program starts when I do not have a file module-info.java, but when I add this file, I get the following error:

Error occurred during initialization of boot layer
java.lang.module.FindException: Module modulefinder not found

Playback steps
1. Create a new maven project
2. Change the compiler and build the jre path to 9
3. Automatically create module.info.java
4. Update the junit dependency in junit to 4.12 if eclipse complains about 5. Run the project

Is this an eclipse-related issue, or am I missing something when starting a project?

The version of Eclipse FYI that I use is Oxygen.1a Release (4.7.1a)

+3
source share
2 answers

Found an answer based on the output of intellij :) I had to add the location of the classes to the vm arguments in the startup configurations, as well as the module name / path to main. as shown below. For more information about -mand-p

see team java -help

enter image description here

+3
source

where did you get the path name for -p and -m?

I downloaded the JDK and eclipse version ... and I get the following error message if I try to run my TestProjekt (plug-in)

An error occurred while initializing the boot layer. Java.lang.module.FindException: Unable to get the module descriptor for D: \ ImageJ \ ij152 \ ImageJ \ ij.jar. Reason: java.lang.module.InvalidModuleDescriptorException: MacClipboard.class is at the top of the directory level (anonymous package is not allowed in the module)

- ?

0

Source: https://habr.com/ru/post/1687927/


All Articles