java.lang.UnsupportedClassVersionError: class file version 61.0, this version of the Java Runtime only recognizes up to 55.0
Code compiled for a newer Java version is running on an older JVM.
class file versionhas been compiled by a more recent version of the Java Runtime Meaning
Class file versions map to Java releases: 52 = 8, 55 = 11, 61 = 17, 65 = 21. The runtime must be at least the compile target. Mismatched JAVA_HOME, Docker base images and IDE settings are the usual causes.
Common causes
- App built with JDK 17/21 but run on Java 8/11
- Dependency compiled for a newer Java (e.g. Spring Boot 3 requires 17)
- Different JAVA_HOME for build and run
- Old JRE base image in Docker
⚡ Quick fix
- Run on a JVM ≥ the class version (61 → Java 17)
- Or compile with
--release 11for older runtimes - Update the Docker base image (
eclipse-temurin:17-jre)
Detailed fix by platform
Java
- Set the compile target (Maven):xml
<properties> <maven.compiler.release>17</maven.compiler.release> </properties>
How to diagnose
- Versions — Class version in the message → Java release
- Runtime —
java -versionwhere it runs - Dependencies — Which library requires newer Java?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- ClassNotFoundException java.lang.ClassNotFoundException / NoClassDefFoundError
- Inconsistent JVM-target compatibility Inconsistent JVM-target compatibility detected for tasks 'compileDebugJavaWithJavac' (17) and 'compileDebugKotlin' (1.8)
- JAVA_HOME not set ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Most viewed in Java
Other ways to find it
Where this error sits
Origin: Application & API. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 14 Oct 2026