eclipse中使用maven創建項目JDK版本默認是1.5解決方法


請看解決方案:

1. 修改maven的settings.xml文件。

添加以下行,jdk版本改為自己需要的版本:

<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>

2. 在eclipse中檢查配置文件是否被引用到,之前我的user settting使用的位置不對。

    然后update setttings。

 

 3. 最后選擇創建的項目,更新項目后,引用的jdk版本自動刷新。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM