Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set up java 10 in Eclipse Oxygen?

I am not sure if latest version of eclipse i.e. Oxygen supports java 10 or not. I configured the JRE for java 10 from preferences on my mac machine.

enter image description here

Also, I tried adding maven compiler plugin as below to my pom.xml:-

<plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <source>10</source>
                <target>10</target>
                <compilerVersion>10</compilerVersion>
                <fork>true</fork>
                <executable>/Library/Java/JavaVirtualMachines/jdk-10.jdk/Contents/Home</executable>
            </configuration>
        </plugin>

I also tried after setting the Run Configurations as below:-

enter image description here

Anybody knows how could I make it work for java-10.

I tried running code below:-

public class App {
    public static void main(String[] args) {
        var list = new ArrayList<String>();
        System.out.println("Hello World!");

    }
}

Update:- I applied the suggested patch in comment and it still fails.

Screenshot below:-

enter image description here

Also, I followed this post to make it compile. So, compilation actually worked from eclipse (maven install) but it still fails when I try to run the application.

like image 915
Vinay Prajapati Avatar asked Mar 22 '18 19:03

Vinay Prajapati


People also ask

Which Java version is compatible with Eclipse Oxygen?

Eclipse 4.7 (Oxygen) A Java 8 or newer JRE/JDK is required to run all Oxygen packages based on Eclipse 4.7, including running the Installer.

Does Eclipse oxygen support Java 11?

I am pleased to announce Java 11 support for Eclipse 2018-09 (4.9). The release notably includes the following Java 11 features: Nest-Based Access Control (JEP 181) Basic support for Dynamic Class-File Constants (JEP 309)

Does Eclipse oxygen support Java 9?

Users who install Eclipse Oxygen 4.7. 1a are able to launch with Java 9 and get Java 9 support, and the configuration described below won't be necessary anymore.


1 Answers

So, I requested eclipse to look into it and see why the patch don't work.

Here is the answer I got

Below is the exact comment from Eclipse community:-

Note: This feature patch is disabled. It was originally intended to be installed on top of 4.7.3 builds. Now, the Java 10 support is available on the downloads page via the 4.7.3a builds. The earliest build that is supporting this feature can be downloaded from

So download the supporting build from here. And see the new features of Eclipse with java 10 here.

Hope it helps!

Edit: The patch support was temporary and has been removed. So, now you need to install the latest eclipse version and it's having the support for java 10

like image 73
Vinay Prajapati Avatar answered Sep 23 '22 00:09

Vinay Prajapati