Eclipse JRE System Library [J2SE-1.5] Eclipse JRE System Library [J2SE-1.5] java java

Eclipse JRE System Library [J2SE-1.5]


The problem is not with Eclipse, but with the projects you're importing. m2e will set the project's JRE to match the maven project. The POM specifies the JRE version, and this is defaulted to 1.5 if not present. You need this in the POM:

<build>     <plugins>        <plugin>                <groupId>org.apache.maven.plugins</groupId>                <artifactId>maven-compiler-plugin</artifactId>                <version>3.0</version>                <configuration>                   <source>1.7</source>                   <target>1.7</target>                </configuration>        </plugin>    </plugins></build>


artbristol gave the correct answer (and I upvoted him).

That was in 2012. Here is an update more appropriate for today (2016, Java 8, Spring 4.x/Servlet 3.x):

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


The root cause of this issue is Eclipse cannot resolve a valid value for the maven.compiler.source property when updating the .classpath file from the pom, it is simply using default one i.e

org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5.

Just Add following properties into you pom.xml and update project:

<properties>            <javaVersion>1.8</javaVersion>            <maven.compiler.source>${java.version}</maven.compiler.source>            <maven.compiler.target>${java.version}</maven.compiler.target></properties>