TestingDocs.com
Software Testing website
  • Automation
    • Selenium
    • JBehave Framework
  • Tutorials
    • MySQL Tutorials
    • Testlink
    • Maven
    • Git
  • IDEs
    • IntelliJ IDEA
    • Eclipse
  • Flowcharts
    • Flowgorithm
    • Raptor
  • About

Apache Maven

Fix Fatal Error compiling: Invalid target release in Maven Project

Overview

In this tutorial, we will learn steps to resolve the following Fatal error compiling: invalid target release: <version number>  in Maven Project.

Error Trace

When we build the Maven project, the following error pops up. For more details run the maven command with -X option.

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project DocsJBehave: Fatal error compiling: error: invalid target release: <version number> -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project DocsJBehave: Fatal error compiling

 

Invalid Target Java Error

Fix

The problem is that there is mismatch in the Java/JDK versions. The project is trying to use a particular Java version to build the project. However, the system doesn’t support the Java version the project is intended to build upon.

First things first, decide on which Java/JDK version you want to use. Check the project configuration files pom.xml to know the details.

Target Version Java

If the information is not in the project. Check the IDE configuration.

System JDK Information

Check the System Information.

Windows

\> echo %JAVA_HOME%

Linux

$ echo $JAVA_HOME

System Java Info

In this example, we will fix the Project setup. we will just change the Maven configuration to use JDK 14.

Update the Project and Build it from the IDE.

Alternatively, run the mvn clean install -X from the command shell.

Project Build Success JBehave Invalid Target

 

Run the build tool in debug mode to know what exactly happens under the hood. This approach can be followed to identify any other problems in the project as well.

That’s it. In this tutorial, we have learn how to troubleshoot Maven project errors.

—

Maven Tutorials on this website can be found at:
https://www.testingdocs.com/apache-maven-tutorial/

For more details on the Apache Maven, visit the official website at:
https://maven.apache.org/

Related Posts

Maven Download Verification Win11

Apache Maven /

Download Maven on Windows 11

Maven Project from archetype

Apache Maven /

Create Maven Project from Archetype using NetBeans IDE

Create New Project

Apache Maven /

Create a Maven Project skip archetype

Maven Download Button

Apache Maven /

Install Maven on Ubuntu Linux

Maven Archetype plugin command line

Apache Maven /

Maven Archetype plugin command line

‹ Create Maven Project from Archetype using NetBeans IDE› Download Maven on Windows 11

Recent Posts

  • Flowchart Control structures
  • Draw a Square using Turtle Graphics
  • Flowgorithm File Errors
  • Write to Text File using Flowgorithm
  • Read Text File using Flowgorithm
  • Flowgorithm Turtle Graphics Flowchart
  • Update Flowgorithm to Latest Version
  • Flowgorithm File Symbols
  • Flowgorithm Turtle Graphics
  • Flowgorithm 3 New Features

Back to Top

Links

  • Contact
  • Privacy Policy
  • Cookie Policy

www.TestingDocs.com

Go to mobile version