The main reason for this problem is that if for some reason Eclipse cannot resolve the valid value for the maven.compiler.source property when creating / updating the .classpath file from pom, it is just the default to use org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5 .
As @ jorge-campos expertly replied, there are many ways to set this property.
However, Jorge's answer did not seem to work for me. Here are my settings:
<properties> <javaVersion>1.8</javaVersion> <maven.compiler.source>${java.version}</maven.compiler.source> <maven.compiler.target>${java.version}</maven.compiler.target> </properties>
...
That's right. ${java.version} never going to ${java.version} (completely different) javaVersion property, and Eclipse ignores the property and uses the default value.
Which brings me back to the " for any reason " section that I opened; Developer stupidity may be one of those reasons.
David Avendasora Dec 09 '17 at 18:15 2017-12-09 18:15
source share