Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse 4.3.2 with Java 8 patches doesn't recognize source level 1.8

I'm using Eclipse 4.3.2 with the patches for Java 8 from, along with m2e and Subclipse, completely updated to the latest versions of everything.

I went into the Maven POMs for our project and changed the maven-compiler-plugin to:

<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
    <source>1.8</source>
    <target>1.8</target>

I updated all my Maven projects tried to do a complete clean and build. Errors all over the place. Ignoring the internal compiler error for the moment, the error I see most is:

Syntax error, static imports are only available if source level is 1.5 or greater

I'm running Java 1.8---why am I getting this message? Is m2e to blame? The maven-compiler-plugin? Or is Eclipse Java 1.8 support simply not ready for prime time?

like image 980
Garret Wilson Avatar asked Mar 27 '14 18:03

Garret Wilson


2 Answers

If you don't want to use an early 1.5 milestone, please note that m2e 1.4.1 ALSO supports Java 8, and you can install it from this update site:

http://download.eclipse.org/technology/m2e/releases/1.4/1.4.1.20140328-1905

It's also on the Eclipse Marketplace:

https://marketplace.eclipse.org/content/java%E2%84%A2-8-support-m2e-eclipse-kepler

And if you happen to be a fan of JBoss Tools, it's coming directly to JBoss Central:

https://issues.jboss.org/browse/JBIDE-17002

like image 145
nickboldt Avatar answered Oct 02 '22 14:10

nickboldt


Apparently m2e doesn't yet support Java 8.

According to Eclipse Bug 420848, you have to install m2e 1.5 M6 from the http://download.eclipse.org/technology/m2e/milestones/1.5 software site. I did this and the source level 1.5 errors went away.

like image 44
Garret Wilson Avatar answered Oct 02 '22 14:10

Garret Wilson