How to Fix "Unsupported Class File Major Version 60" in Intellij Idea

Unsupported class file major version 61

(I incorrectly was zeroing in on the "Unsupported class file major version 61" message without looking at the stacktrace.)

The problem (as pointed out by @Mark Rotteveel) is that glowroot is failing while trying to do some code transformation using ASM. Apparently the ClassReader in the version of ASM that is bundled in glowroot 0.13.6 doesn't understand version 61 (Java 17) class files.

Q: How to solve this?

A: Use glowroot 0.14.0-beta.2 or later; see https://github.com/glowroot/glowroot/issues/906. Alternative, build your application and its dependencies (as required) for an earlier (target) version of Java, and (maybe1) run on an earlier version of Java.


1 - It depends on whether the code transformations involve the ASM ClassReader reading Java SE classes.

Android Studio Error Unsupported class file major version 61

With the help of @Robert answer,

I found out that the problem was with JAVA 17 and that the Gradle JDK in use was:

Android Studio java home version 17.0.1

I changed it to:

Android Studio default JDK version 11.0.10

Sample Image

Then everything worked like before...

You'll find the Gradle Settings under File > Project Structure...

Sample Image

...or through the Toolbar button: Project Structure...

Sample Image

Then click the Gradle Settings link.
Sample Image

How to fix “unsupported class file major version 60” in tomcat9?

As already remarked in the comments by Joachim, your problem is due to the ASM version packaged by Jersey. It is similar to this question regarding Spring.

The easiest way to find the highest version of Java supported by ASM is to look at the source code:

  • Jersey 2.35 supports up to Java 18,
  • Jersey 2.34 supports up to Java 17 (cf. source code),
  • Jersey 2.33 supports up to Java 16,
  • Jersey 2.30 supports up to Java 15 (with a warning for Java 15),
  • Jersey 2.29 supports up to Java 14 (with a warning for Java 14),
  • Jersey 2.28 (first EE4j version) supports up to Java 12.

As for the 3.x branch, all versions support Java 16, while the latest (3.0.2) supports also the upcoming Java 17.

How to solve java.lang.IllegalArgumentException: Unsupported class file major version 61 and Entity was compiled with an unsuppported JDK

The problem you mentioned may also be due to using a library which does some kind of code inspection/generation and is not yet ready to work with this very young class file version. Probably eclipselink is the problem here. Try to upgrade to the latest version and if that does not help go back to Java 16 and totally clean and rebuild your project.

See for example this note: UPDATE ECLIPSELINK TO SUPPORT ASM 9.1 FOR JAVA 17



Related Topics



Leave a reply



Submit