[Fixed] Descriptor error: Unsupported class file major version 61 – Maven

by
Ali Hasan
intellij-idea java-17 maven

Quick Fix: Update the version of maven-plugin-plugin to 3.6.4 or higher to support Java 17 compatibility.

The Problem:

You are encountering an error message ‘Unsupported class file major version 61’ while executing the command ‘mvn clean install -DskipTests’. This error indicates that the class file version is not supported by your current Java version. Despite setting your JDK to version 17, you are still facing this issue. Investigate potential causes for this inconsistency and identify the necessary steps to resolve the error.

The Solutions:

Solution 1: Use updated version of maven-plugin-plugin

Use version 3.6.4 or higher of `maven-plugin-plugin` that is compatible with Java 17. The newest version is currently **3.10.2**. Add the following dependency to your pom.xml file:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-plugin-plugin</artifactId>
    <version>3.10.2</version>
</plugin>

Q&A

Why am I getting an ‘Unsupported class file major version 61’ error when the program is running on Java 17?

The version of maven-plugin-plugin is too low. Use version 3.6.4 or higher.

Video Explanation:

The following video, titled "Related Video", provides additional insights and in-depth exploration related to the topics discussed in this post.

Play video

This video provides further insights and detailed explanations related to the content discussed in the article.