解决:eclipse导入jdk1.8的项目,自动变成jdk1.5版本问题

问题:http://start.spring.io/下载一个jdk1.8的maven初始项目,导入到eclipse莫名的变成1.5。eclipse版本:Kepler Service Release 2

解决:1.eclipse设置好java相关的编译环境为1.8。

           2.设置maven的setting文件,在<profiles>节点下手动添加

            <profile>    
                <id>jdk-1.8</id>    
                <activation>    
                    <activeByDefault>true</activeByDefault>    
                <jdk>1.8</jdk>    
                </activation>    
                <properties>    
                    <maven.compiler.source>1.8</maven.compiler.source>    
                    <maven.compiler.target>1.8</maven.compiler.target>    
                    <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>    
                </properties>    

            </profile>

            3.下载Java 8 Facets for web tools eclipse kepler sr2插件,具体见:https://stackoverflow.com/questions/21955207/version-1-8-of-project-facet-java-does-not-exist

说明:第3步解决了eclipse下新建jdk1.8的maven项目时报“Version 1.8 of project facet java does not exist”。

猜你喜欢

转载自blog.csdn.net/verseboys/article/details/82527288