Eclipse is as confusing as ever. And the splash screens aren’t getting any better…
With the official release of Java 8, Eclipse announced support for Java 8 in Kepler and Luna. In reality, that support is not provided out-of-the-box, especially if you want to use Maven.
In Eclipse Kepler SR2 (4.3.2) (the SR2 part is important), you need to get a JDT patch from the 4.3 update site. There are instuctions in the announcement. Then, add an Installed JRE and an execution environment:
- Window > Preferences > Java > Installed JREs
- Choose JDK 8’s home directory
- Click OK and go to Window > Preferences > Java > Installed JREs > Execution Environment (you have to close the preferences pane because the list of execution environments isn’t updated when you add the Java 8 JDK)
- Select JavaSE-1.8 and check jdk1.8.0
I initially downloaded Luna Milestone 6 and was surprised not to see Java 8 support. By reading the announcement very carefully, it turns out that the earliest Luna build with Java 8 support is from March 18, 2014 and Milestone 6 was released on March 6. So, you can either:
- download the latest 4.4 milestone (4.4M6 at the time of writing) and add the integration builds update site, or
- download I20140325-0830.
In both cases, choose a download from the “Eclipse SDK” section. I took the first option, because of all the big red X’s in the Status column of the integration build.
Luna is still rough. It seems to work, but there are a lot of weird, dev-related items in menus.
When using Maven your work is still not done: setting the maven-compiler-plugin to 1.8 will cause Eclipse to set the project’s compiler level to 1.4.
And there you have it: Java 8 and Maven in Eclipse, in 657 easy steps!