当出现这个错误时,原因是之前maven默认项目是JDK5,而maven不再支持java1.5,所以需要我们改成自己的版本。

 

maven报错:Error:java: 不再支持源选项 5。请使用 6 或更高版本。

 

 


解决方法:   

  1、在maven的安装目录下,找到conf文件,打开settings.xml文件,在<settings></settings>标签里插入下面的代码

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

相关文章:

  • 2022-02-12
  • 2021-07-18
  • 2021-11-11
  • 2021-04-13
  • 2021-11-27
  • 2021-08-06
  • 2021-05-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-07-13
  • 2021-10-14
  • 2021-06-14
相关资源
相似解决方案