Following up on responses to my tweet and post yesterday, here’s a summary of the suggestions to get Java 10 support working with Eclipse 4.7.3a RC1:
- Download the 4.7.3a RC1 build. Yesterday I had tried the 4.7.3a M20180322-1835 build as stated on the previously available Java 10 support plugin:
but the recommendation from Noopur Gupta was to download the 4.7.3a RC1 release which looks like it’s after the M20180322 release, and this apparently has specific support for the new var keyword:
2. Ensure have the latest Maven m2e plugin for Maven support is installed:
3. Configure Maven pom.xml with the maven-compiler-plugin v3.7.0 and set the source and target versions to 10. Instead of setting the source and compile version in properties like this:
<properties> <maven.compiler.source>10</maven.compiler.source> <maven.compiler.target>10</maven.compiler.target> </properties>
This tweet shows setting the 10 value as a <release> property:
Getting #m2e ready for the Java 10 release next month. #worksonmymachine pic.twitter.com/ULCDOCQakR
— Fred Bricon (@fbricon) February 23, 2018
So replacing the source and target properties that I normally use, and using this:
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.7.0</version> <configuration> <release>10</release> </configuration> </plugin> </plugins> </build>
Now doing a Maven Update on my project, and what do you know, now it’s switched to Java 10:
And here it it, the var keyword in all it’s glory:
Thanks for everyone’s tips and suggestions to get this working!