UnsupportedClassVersionError: matching Java to Minecraft
Class file version 65.0 means Java 21. Here is the full mapping, which Minecraft version needs which Java, and what to do when a single mod is the one complaining.
The short version
UnsupportedClassVersionError means the Java version running the server is older than the version the code was compiled with. The message gives two numbers: class file version 65.0 is Java 21, 61.0 is Java 17, 52.0 is Java 8. Minecraft 1.20.5 and later need Java 21; 1.17 to 1.20.4 need Java 17.
This error is unusually honest. It tells you exactly what it found and exactly what it can handle, in numbers that mean nothing until somebody gives you the table.
#Reading the error
java.lang.UnsupportedClassVersionError: com/example/Thing has been compiled by a
more recent version of the Java Runtime (class file version 65.0), this version
of the Java Runtime only recognizes class file versions up to 61.0
Two numbers, both class file versions rather than Java versions. Here is the mapping:
| Class file version | Java version |
|---|---|
| 52.0 | Java 8 |
| 55.0 | Java 11 |
| 61.0 | Java 17 |
| 65.0 | Java 21 |
| 66.0 | Java 22 |
So the example above says: this code needs Java 21, the server is running Java 17.
It never goes the other way round. Newer Java runs older code perfectly happily; older Java cannot run newer code, because the format did not exist when it was written.
#Which Java each Minecraft version needs
| Minecraft version | Java |
|---|---|
| 1.20.5 and later | Java 21 |
| 1.18 to 1.20.4 | Java 17 |
| 1.17.x | Java 16 or 17 |
| 1.16.5 and earlier | Java 8 |
Mods can raise this. A mod compiled for Java 21 needs Java 21 regardless of what Minecraft version it targets, which is where the single-mod version of this error comes from.
Mods rarely lower it, but 1.12.2 packs are a genuine exception: much of that ecosystem expects Java 8 specifically, and running it on anything newer produces its own separate collection of problems.
#On Hostd
The Java version is selected to match the Minecraft version you are running, so the plain version of this error is uncommon. When it appears, it is usually one of:
- A modpack pinned to a Minecraft version whose mods have moved ahead of it. A pack on 1.20.1 that has pulled in a mod built for Java 21 will hit this.
- A hand-uploaded mod jar built for a newer Java. Check the mod's page for the Java version it targets, which is usually stated alongside the Minecraft version.
- A world or pack imported from another host that was running a different Java version than the game version implies.
If the whole server fails to start with this error rather than a single mod, open a ticket with the crash: the runtime and game version are out of step and that is ours to fix.
#What you cannot do about it
You cannot make a mod run on an older Java by changing a setting. The class file format is not negotiable and there is no compatibility flag.
The options are: get a build of the mod for your Java version, or move the server to a Minecraft version that runs on the Java the mod needs. For a single mod in a hand-built list, the first. For a pack, the second, which usually means picking a newer release of the pack.
#The reverse case
Occasionally 1.12.2 servers throw errors that look related but are not: a pack built for Java 8 running on Java 17 tends to fail with reflection and module access errors rather than an UnsupportedClassVersionError, because the code loads fine and then cannot reach the internals it expects.
If you are running a 1.12.2 pack such as RLCraft and seeing errors about illegal reflective access, that is the shape of it.
#Frequently asked questions
What does class file version 65.0 mean?
Java 21. The class file version numbers run 52 for Java 8, 61 for Java 17, 65 for Java 21 and 66 for Java 22. If the error says your runtime only recognises up to 61.0 and the code is 65.0, you are running Java 17 against code built for Java 21.
What Java version does my Minecraft server need?
Minecraft 1.20.5 and later need Java 21. Versions 1.17 through 1.20.4 need Java 17. Versions 1.16.5 and earlier run on Java 8, and 1.12.2 in particular is happiest there. Mods can raise the requirement above what the game itself needs.
One mod causes UnsupportedClassVersionError. What now?
That mod was compiled for a newer Java than the server runs. Either find a build of the mod targeting your Java version, or move the server to a Minecraft version that runs on the newer Java. You cannot mix: the JVM either understands the class file format or it does not.
Written and maintained by the Hostd engineering team. Last updated 2026-08-05. Notice a mistake? Tell us.