How to configure java 10 in Eclipse Oxygen?

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

enter image description here

In addition, I tried to add the maven compiler plugin as shown 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 to set launch options as shown below:

enter image description here

Does anyone know how I can make it work on java-10.

I tried to run the 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 proposed patch in the comment and it still does not work.

Screenshot below:

enter image description here

In addition, I followed this post to compile it. So, the compilation did work with eclipse ( maven install ), but it still fails when I try to run the application.

+16
source share
1 answer

So, I asked the eclipse to study it and see why the patch does not work.

Here is the answer I received

The following is an accurate comment from the Eclipse community: -

Note. The patch for this feature is disabled. It was originally supposed to be installed on top of 4.7.3 assemblies. Java 10 support is now available on the download page through builds 4.7.3a. The earliest build supporting this feature can be downloaded from

So download the supporting assembly here . And check out the new features of Eclipse with java 10 here .

Hope it helps!

Edit: support for patches was temporary and was removed. So now you need to install the latest version of eclipse and have java 10 support

+6
source

Source: https://habr.com/ru/post/1276028/


All Articles