Eclipse-添加module-info.java时找不到模块

Ger*_*mer 6 java eclipse java-platform-module-system java-9

我在eclipse中有一个简单的hello world项目,希望使用Java 9运行。该程序在没有module-info.java文件时运行,但是在添加该文件时出现以下错误:

Error occurred during initialization of boot layer
java.lang.module.FindException: Module modulefinder not found
Run Code Online (Sandbox Code Playgroud)

重现步骤
1.创建一个新的maven项目
2.更改编译器并将jre的构建路径设置为9
3.自动生成module-info.java
4.如果eclipse抱怨,请将junit中的junit依赖关系更新为4.12
5.运行该项目

这是与月食相关的问题,还是在运行项目时丢失了某些东西?

我使用的FYI Eclipse版本是Oxygen.1a版本(4.7.1a)

Ger*_*mer 6

根据intellij的输出找到了答案:)我必须将类的位置添加到运行配置中的vm参数中,以及模块名称/ main路径。像下面 请参阅java -help命令以获取有关-m和的更多信息。-p

在此处输入图片说明

  • 仅供参考,其他相关的增强请求是:[bug 525253](https://bugs.eclipse.org/bugs/show_bug.cgi?id=525253)和[bug 520713](https://bugs.eclipse.org/bugs /show_bug.cgi?id=520713) (2认同)