Error “Source option 5 is no longer supported. Use 6 or later” on Maven compile

前端 未结 10 618
长情又很酷
长情又很酷 2021-02-01 01:27

I am getting the following error or $ mvn compile:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on         


        
10条回答
  •  再見小時候
    2021-02-01 01:34

    This helped me:

    1. Right Click on Project.
    2. Click on Build path.
    3. Click on Configure Build path.
    4. It opens a Java Build path window.
    5. Click on Java Compiler in the Left side.
    6. It navigates to Java Compiler window in that to set the Compiler compliance level is set as according to your jre version(ex if java version is 1.8 then choose 1.8) as select.
    7. Click on [Apply] button.
    8. Click on [OK] button.
    9. Right click on Project > Maven > Update the project.
    10. Right click on Project > Run As > Maven install -- The pom.xml file is running and java jars are download and installed to project.
    11. Right click on Project > Run As > Maven Test -- The pom.xml file is running and java jars are download and installed to project.

    Then you got the Build Success message and your maven project is created successfully.

提交回复
热议问题