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

    xiaoxiao2021-03-25  149

    新建的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版本了

    转载请注明原文地址: https://ju.6miu.com/read-6182.html

    最新回复(0)