Saturday, March 23, 2013

Java compiler level does not match the version of the installed Java project facet.

I have created a webapp artifact with maven:

mvn archetype:generate -DgroupId=com.acme.osb -DartifactId=wlobelix -DarchetypeArtifactId=maven-archetype-webapp -DinteractiveMode=false
mvn eclipse:eclipse -Dwtpversion=2.0

When I open the project with Eclipse, I get:

Java compiler level does not match the version of the installed Java project facet.
Faceted Project Problem (Java Version Mismatch)



Don't panic: it's normal with Maven that things take 10 times more than normal and require a lot of manual hacks and desperate googling.

Just right-click on the project in Eclipse, Project facets, and set it to 1.6 (I assume your Workspace default is 1.6). For some strange reason Maven defaults to 1.4. My grandmother - deceased in 2009 at the age of 97 - used to code in 1.6, so I guess that Maven authors are older than her - maybe they are Trilobites, who ruled the Earth some 500 million years ago. Welcome to the 21st century, pals.





No comments: