Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
823 views
in Technique[技术] by (71.8m points)

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 runs when I don't have a module-info.java file but when I add that file I get the following error:

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

Steps to reproduce
1. Create a new maven project
2. Change compiler and build path jre to 9
3. Auto generate module-info.java
4. Update junit dependency in junit to 4.12 if eclipse complains
5. Run the project

Is this an eclipse related issue or am I missing something when running the project?

FYI eclipse version I use is Oxygen.1a Release (4.7.1a)

See Question&Answers more detail:os

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

1 Reply

0 votes
by (71.8m points)

Found the answer based on intellij output:) I had to add the location of the classes to the vm arguments in the run configurations as well as the module name/path to main. like below. See the java -help command for more info regarding -m and -p

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...