Maven + Eclipse 氧气 + Java 9

Maven + Eclipse Oxygen + Java 9

我创建了一个非常基本的 maven 项目:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>de.jotschi</groupId>
    <artifactId>test</artifactId>
    <version>0.0.1-SNAPSHOT</version>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.7.0</version>
                <configuration>
                    <source>9</source>
                    <target>9</target>
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>

它只有一个 de.jotschi.App 主 class 和一个定义和导出模块的 /test/src/main/java/module-info.java 文件:

module test {
  exports de.jotschi;
}

如果我在 eclipse 中 运行 应用程序 class 我会看到以下错误:

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

Eclipse:Oxygen.1 版本 (4.7.1) + Java9 对 Oxygen 的支持

Java: 9+181

Java 9 Support for Oxygen does not include patches for the Eclipse Maven support.

or test an Oxygen.1a release candidate (but note, there is a known Maven Java 9 issue in RC1 which has been fixed two days ago).


更新Eclipse Oxygen 4.7.1a is now released. If you update Eclipse Oxygen with Java 9 BETA Support for Oxygen, uninstall Java 9 BETA manually (see Eclipse bug 526065)。