Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven + Eclipse Oxygen + Java 9

I created a very basic maven project:

<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>

It just has an de.jotschi.App main class and a /test/src/main/java/module-info.java file which defines and exports the module:

module test {
  exports de.jotschi;
}

If I run the App class within eclipse I see the following error:

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

Eclipse: Oxygen.1 Release (4.7.1) + Java 9 Support for Oxygen

Java: 9+181

like image 340
Jotschi Avatar asked Jan 30 '23 10:01

Jotschi


1 Answers

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

Please wait for Oxygen.1a 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).


Update: 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).

like image 76
howlger Avatar answered Feb 03 '23 23:02

howlger