Default jdk version of maven project in eclipse

When using eclipse to create a maven project, the default jdk version is 1.5, and each time it is manually changed to the required jdk version, such as 1.8, after executing the maven-update project, the manually set jdk version is switched to the default jdk1.5, which is a headache. .

Solution: Modify settings.xml in conf in the maven installation directory
<profile>  
    <id>jdk-1.7</id>  
    <activation>  
          <activeByDefault>true</activeByDefault>  
          <jdk>1.7</jdk>  
    </activation>  
    <properties>  
        <maven.compiler.source>1.7</maven.compiler.source>  
        <maven.compiler.target>1.7</maven.compiler.target>  
        <maven.compiler.compilerVersion>1.7</maven.compiler.compilerVersion>  
    </properties>  
</profile>
Finally, execute maven "Update Project in eclipse, and the JDK version will become the specified version.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326688251&siteId=291194637