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

前端 未结 9 2503
谎友^
谎友^ 2021-02-01 00:54

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         


        
相关标签:
9条回答
  • 2021-02-01 01:47

    I was facing the same issue and resolved it with the lines of code below:

    <properties>
       <maven.compiler.source>1.6</maven.compiler.source>
       <maven.compiler.target>1.6</maven.compiler.target>
     </properties>
    
    0 讨论(0)
  • 2021-02-01 01:49

    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.

    0 讨论(0)
  • 2021-02-01 01:52

    For the new Apache net Bean its a little bit different from the suggestion by SUPARNA SOMAN

    • Right Click on your Project -Hover on "set configuration" and click customize configuration -.A new dialogue box opens....
    • At the left corner where the categories are, Click on "Source"
    • At the select form on the page below, select your required version of JDK ----see image for this last step.the last step required to change jdk version
    0 讨论(0)
提交回复
热议问题