Update the project with maven, and the JRE System Library that the project depends on will automatically become JavaSE-1.4.
Solution 1: Modify the default jdk configuration
of maven Find the place where the jdk configuration is found in the conf\setting.xml file of maven, and modify it as follows:
<profile> <id>jdk1.6</id> <activation> <activeByDefault>true</activeByDefault> <jdk>1.6</jdk> </activation> <properties> <maven.compiler.source>1.6</maven.compiler.source> <maven.compiler.target>1.6</maven.compiler.target> <maven.compiler.compilerVersion>1.6</maven.compiler.compilerVersion> </properties> </profile>
Solution 2: Modify the pom.xml file in the project, so as to avoid specifying
the pom.xml file in the project to be opened by the jdk version when importing the project, and modify it as follows:
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> </plugins> </build>