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



 
    