# Maven "Unsupported class file major version 65" - Fix in CI

> Fix "Unsupported class file major version 65" in CI - a bytecode-manipulation tool (ASM in a plugin) cannot read Java 21 (major 65) classes because the plugin or its ASM is too old.

Source: https://latchkey.dev/learn/java-jvm/maven-unsupported-class-file-major-version-65-in-ci  
Updated: 2026-06-26

A tool that parses bytecode (ASM, used by shade, jacoco, lombok-style plugins, or a scanner) hit a class compiled for Java 21 (class-file major version 65) and does not understand that version yet. The plugin or its bundled ASM predates the JDK you compiled with.

## Diagnose it: which JDK is the build actually using?

JVM builds resolve a toolchain from several sources, and the one on PATH is often not the one compiling your code. A version mismatch surfaces as an unsupported class file version rather than as a toolchain error.

```Terminal
java -version 2>&1
echo "JAVA_HOME=$JAVA_HOME"
./gradlew -q javaToolchains 2>/dev/null || mvn -v

# class file 65 = Java 21, 61 = Java 17, 55 = Java 11
javap -verbose <SomeClass>.class | grep "major version"
```

> Pin the JDK with `setup-java` and declare the toolchain in the build file. Relying on whichever JDK the runner image ships makes an image update a build break.

## FAQ

### What causes Maven "Unsupported class file major version 65"?

There are 3 common causes: a bytecode plugin is too old for the jdk, compiling with a newer jdk than the tools expect, and a transitive asm pinned too low. JaCoCo, Shade, or another ASM-based plugin bundles an ASM that does not yet support the major version your JDK emits.

### How do I fix Maven "Unsupported class file major version 65"?

There are 3 fixes depending on which cause you have: upgrade the offending plugin, align the compile target with tool support, and override a too-low transitive asm. Work through them in order, since the first is the most common.

### What does Maven "Unsupported class file major version 65" actually mean?

A plugin goal throws IllegalArgumentException: Unsupported class file major version 65 (65 = Java 21; 64 = Java 20; 63 = Java 19) from deep inside an ASM ClassReader.

### How do I stop Maven "Unsupported class file major version 65" happening again?

Bump ASM-based plugins (JaCoCo, Shade) whenever you raise the JDK. The prevention section lists 3 changes that keep it from recurring.

---

Latchkey runs CI/CD that repairs its own failures. Agent entry points: https://latchkey.dev/agent.txt, https://latchkey.dev/openapi.json, https://latchkey.dev/llms.txt
