close

[Solved] compile (default-compile) on project spring-rest: Fatal error compiling: invalid flag

Hello Guys, How are you all? Hope You all Are Fine. Today Whenever I am starting spring-boot I am facing following error compile (default-compile) on project spring-rest: Fatal error compiling: invalid flag in Java. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How compile (default-compile) on project spring-rest: Fatal error compiling: invalid flag Error Occurs ?

Whenever I am starting spring-boot I am facing following error.

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project spring-rest: Fatal error compiling: invalid flag: --release -> [Help 1]

How To Solve compile (default-compile) on project spring-rest: Fatal error compiling: invalid flag Error ?

  1. How To Solve compile (default-compile) on project spring-rest: Fatal error compiling: invalid flag Error ?

    To Solve compile (default-compile) on project spring-rest: Fatal error compiling: invalid flag Error First of all Open your pom.xml file. Then Find maven-compiler-plugin configuration. And simply remove the tag <release>8</release> from your maven-compiler-plugin configuration.Now, try to rerun your project. Your error must be solved.

  2. compile (default-compile) on project spring-rest: Fatal error compiling: invalid flag

    To Solve compile (default-compile) on project spring-rest: Fatal error compiling: invalid flag Error First of all Open your pom.xml file. Then Find maven-compiler-plugin configuration. And simply remove the tag <release>8</release> from your maven-compiler-plugin configuration.Now, try to rerun your project. Your error must be solved.

Solution 1: Remove tag release from maven-compiler-plugin

  1. First of all Open your pom.xml file.
  2. Then Find maven-compiler-plugin configuration.
  3. And simply remove the tag <release>8</release> from your maven-compiler-plugin configuration.
  4. Now, try to rerun your project.
  5. Your error must be solved.
  6. Your POM.xml Look like.
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.7.0</version>
    <configuration>
        <source>1.8</source>
        <target>1.8</target>
        <verbose>true</verbose>
    </configuration>
</plugin>

Summary

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?

Also, Read

Please Rate Our Solution to Motivate Us For Give Our Best

Leave a Comment