DEA runs Maven to compile project source code compile project compilation error: [ERROR] Source option 5 is no longer supported. Please use version 6 or higher. [ERROR] Target option 1.5 is no longer supported. Please use version 1.6 or higher.

1. The cause of the problem and the error picture

  1. problem causes

    原因是有多个版本的jdk,导致maven不知道该用哪个

  2. Error picture

    insert image description here
    insert image description here

2. Solution (configure pom.xml file)

  • File→Settings→Maven→Runner→Select the corresponding JDK version

  • insert image description here
    insert image description here

  • The pom.xml file is added to specify the corresponding JDK version

    <properties>
    	<maven.compiler.source>11</maven.compiler.source>
    	<maven.compiler.target>11</maven.compiler.target>
    </properties>
    

    insert image description here

Summarize

Maven设置要和pom.xml配置文件指定的JDK版本要一致

Guess you like

Origin blog.csdn.net/weixin_44904239/article/details/131471551