close

[Fixed] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project demo: Fatal error compiling: invalid target release: 11

Today We are Going To Solve Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project demo: Fatal error compiling: invalid target release: 11 in Java. Here we will Discuss All Possible Solutions and How this error Occurs So let’s get started with this Article.

How to Fix Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project demo: Fatal error compiling: invalid target release: 11 Error?

  1. How to Fix Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project demo: Fatal error compiling: invalid target release: 11 Error?

    To Fix Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project demo: Fatal error compiling: invalid target release: 11 Error just Add java version in pom.xml. This is the very easy method to solve this error. You have to just add java version in pom.xml. add this below code in your pom file. and your error will be solved. <properties> <java.version>1.8</java.version> </properties>

  2. Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project demo: Fatal error compiling: invalid target release: 11

    To Fix Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (default-compile) on project demo: Fatal error compiling: invalid target release: 11 Error just Add your contex in pom.xml. To solve your error you have to just add contex in pom.xml. <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin>

Solution 1 : Add java version in pom.xml

This is the very easy method to solve this error. You have to just add java version in pom.xml. add this below code in your pom file. and your error will be solved.

<properties>
    <java.version>1.8</java.version>
</properties>

Solution 2 : Add your contex in pom.xml

To solve your error you have to just add contex in pom.xml.

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <configuration>
        <source>1.8</source>
        <target>1.8</target>
    </configuration>
</plugin>

Conclusion

So these were all possible solutions to this error. I hope your error has been solved by this article. In the comments, tell us which solution worked? If you liked our article, please share it on your social media and comment on your suggestions. Thank you.

Also Read This Solutions

Leave a Comment