After running mvn eclipse:eclipse
your project's are using a different JDK than expected.
maven-compiler-plugin
?For example, setting the source to 1.6 compliance?
<plugin> <artifactId>maven-compiler-plugin</artifactId> <version>2.0.2</version> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin>
In eclipse's preferences check Java > Installed JREs and that the selected one is the version you expect.
In eclipse's preferences check Java > Installed JREs > Execution Environment has a bound value for compatible JREs.
For example, JavaSE-1.6 should have "perfect match" or an Installed JRE selected as being compatible.
.claspath
specifies the correct Java container?Open the .classpath
file and look for the <classpathentry kind="con"
entry.
It should either be using the default JRE:
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
Or it should be a specified execution environment:
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>