新建的maven项目默认jdk版本不匹配_01

来源:互联网 发布:四川大学软件学院课程 编辑:程序博客网 时间:2024/04/30 07:22

新建的maven项目默认jdk版本不匹配

1.在maven的安装目录编辑文件conf/settings.xml文件,找到<profiles></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>


2.打开eclipse->windows->preferences->Maven->User Settings窗口中选中UserSettings的“Browse”重新选择

刚刚maven安装目录下编辑的settings.xml


3.eclipse重新新建maven项目发现jdk引用的是刚刚配置的1.8版本了

0 0
原创粉丝点击