4

Configuration : Java : 16
Gradle : 7.2
Jacoco : 0.8.4

When I upgraded my project from openJDK8 to openJDk16 I see the following issues :

"Caused by: java.lang.IllegalArgumentException: Unsupported class file major version 60"

And also the below issue :
java.lang.instrument.IllegalClassFormatException: Error while instrumenting sun/security/ec/SunEC$1. at org.jacoco.agent.rt.internal_035b120.CoverageTransformer.transform(CoverageTransformer.java:93) at java.instrument/java.lang.instrument.ClassFileTransformer.transform(ClassFileTransformer.java:244

  • The error actually means that the class was compiled with higher java version (16) but run with lower one (8). Check gradle JVM version by the command: `./gradlew -version` and make sure that gradle uses `16` (check `JAVA_HOME` in environment variables) – J-Alex Oct 13 '21 at 10:59
  • 1
    Does this answer your question? [How to fix "unsupported class file major version 60" in IntelliJ?](https://stackoverflow.com/questions/67079327/how-to-fix-unsupported-class-file-major-version-60-in-intellij) – Martin Zeitler Oct 13 '21 at 12:20

1 Answers1

1

I had a similar problem and fix it by chaining Gradle JVM settings in my preferred IDE which is IntelliJ (should be possible with others too):

  1. In the Settings/Preferences dialog, go to Build, Execution, Deployment | Build Tools | Gradle.

  2. Under the Gradle section, change the Gradle JVM option.

If you are using Intellij you can see more on this topic here

Mark Rotteveel
  • 90,369
  • 161
  • 124
  • 175