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.

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:

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:

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.
source share