. Advertisement .
..3..
. Advertisement .
..4..
If you are getting an error in compiling the project in Java, then there are different approaches to resolving it. Here, we discuss how to resolve the ‘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 in compiling Java project.
How Can You Fix The “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” Problem?
You may get the following issue when trying to run your project with Java 11.
[ERROR] 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 -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
To resolve this problem, before using maven, utilize set JAVA_HOME=C:\path\to\jdk11 on the first line, and your problem will disappear. The second option is to simply check the JRE that Maven is using. Firstly, operate configurations. Pick your Maven Build configuration after that. Now, go to the JRE tab and select the JRE version that corresponds to your POM.
Approach 1: In pom.xml, you have to include your own context.
This problem will be resolved in the most recent version of pytube, 11.0.0. Simply run this command to upgrade it:
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.8</source> <target>1.8</target> </configuration> </plugin>
Approach 2: Set JAVA_HOME
Try set JAVA_HOME=C:\path\to\jdk11 on the first line before using maven, and your problem should be solved.
python -m pip install git+https://github.com/Zeecka/pytube@fix_1060
Approach 3: Include the Java version in pom.xml
In pom.xml, include the Java version. In your pom file, paste the following code.
<properties> <java.version>1.8</java.version> </properties>
Approach 4: Examine JRE version
- Just make sure you’re using the right JRE for Maven.
- Firstly, operate configurations.
- Pick your Maven Build configuration after that.
- Now, go to the JRE tab and select the JRE version that corresponds to your POM.
Conclusion
The error “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” is a confusing error message. We hope this blog has helped clear the air around what this error message means and how to solve it. If you have more questions about this issue, please leave a comment below. Thank you for reading; we are always excited when one of our posts can provide useful information on a topic like this!
Leave a comment