// crash guide
Fix "Unsupported class file major version" on a Minecraft server
Your server is running a different Java version than Minecraft, your mod loader or one of your mods was built for. Usually Java is too old (on old packs, too new), and the fix is to run the Java that matches your Minecraft version.
What the error looks like
The most common form. The server’s Java is older than the code it’s trying to load:
Error: LinkageError occurred while loading main class net.minecraft.bundler.Main
java.lang.UnsupportedClassVersionError: net/minecraft/bundler/Main 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
A Minecraft 26.1 or newer server, which needs Java 25, started on Java 21 gives the same error with bigger numbers:
java.lang.UnsupportedClassVersionError: net/minecraft/bundler/Main has been compiled by a more recent version of the Java Runtime (class file version 69.0), this version of the Java Runtime only recognizes class file versions up to 65.0
The class before “has been compiled” can be Minecraft’s (net/minecraft/...), the loader’s, or a mod’s. It matters which one (see step 3 below).
On Java 8 the wording is different when the startup class itself fails, and the last number is always 52.0:
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: net/minecraft/bundler/Main has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 52.0
Forge 1.17+ and NeoForge servers started from run.sh or run.bat on Java 8 fail even earlier, with no version numbers at all:
Error: Could not find or load main class @user_jvm_args.txt
Another form comes from the class-reading library (ASM) inside the loader or Mixin:
java.lang.IllegalArgumentException: Unsupported class file major version 65
On Java 25 the same line ends in 69: Unsupported class file major version 69.
The last one comes from Forge for 1.12.2 and older, started on any Java newer than 8:
java.lang.ClassCastException: class jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to class java.net.URLClassLoader (jdk.internal.loader.ClassLoaders$AppClassLoader and java.net.URLClassLoader are in module java.base of loader 'bootstrap')
Where to find it
If the error names net/minecraft/bundler/Main, the loader’s launcher class or @user_jvm_args.txt, the server died before Minecraft started logging. There is no crash report, and logs/latest.log may still be from the last run. Read the console output instead (the Console tab on a Pelican panel).
If it fails later, while mods load, check logs/latest.log and the newest file in crash-reports/. Forge and NeoForge also write logs/debug.log.
What it means
Java code is compiled into class files, and each one is stamped with a version number. Subtract 44 and you get the Java version it needs.
| Class file version | Java version | Minecraft versions that need it |
|---|---|---|
| 52 | Java 8 | 1.16.5 and older |
| 60 | Java 16 | 1.17.x |
| 61 | Java 17 | 1.18 to 1.20.4 |
| 65 | Java 21 | 1.20.5 to 1.21.11 |
| 69 | Java 25 | 26.1 and newer |
| 70 | Java 26 | None, as of October 2026 |
So the first example says: this code needs Java 21 (65), and the server is running Java 17 (61). The “only recognizes class file versions up to” number is what you have. The other number is what you need. “Class file version 69.0” means Java 25, which every Minecraft 26.1 and newer server needs.
No Minecraft version needs Java 26 (class file 70). If you see 70, either a mod was built for Java 26, or the server runs Java 26 and its loader can’t read Java 26’s class files. Either way, go back to the Java in step 2 below.
“Unsupported class file major version” uses the same numbers, but it can point either way:
- Java too old for a mod. A mod built for a newer Java got into your pack. Usually it’s a mod made for a newer Minecraft version.
- Java too new for the loader. An old loader or Mixin, typically on 1.16.5 or earlier, can’t read the class files of the newer Java you’re running. Older Forge 1.20.1 builds on Java 25 can hit this too (here’s why).
To tell them apart, subtract 44 from the number and compare it to the Java you run. Higher means something needs a newer Java. The same as yours probably means the loader is too old for your Java.
The JNI and @user_jvm_args.txt errors both mean the server is on Java 8 and needs a newer one. The URLClassLoader error is the opposite: Java too new for an old Forge.
Common in these packs: RLCraft (1.12.2, Java 8 only), Vault Hunters 3rd Edition (1.18.2, Java 17), All the Mods 10 (1.21.1, Java 21) and GregTech: New Horizons, which runs on 1.7.10 but ships separate server files for Java 8 and for Java 17 to 25. Moving a server from one of these to another is the classic way to end up on the wrong Java.
How to fix it
- Find your Minecraft version.
It’s on the modpack’s page, and in the folder names under
libraries/net/minecraftforge/forge/orlibraries/net/neoforged/neoforge/. For 1.x versions, NeoForge drops the leading “1.”: NeoForge 21.1.x is for Minecraft 1.21.1. From 26.1 on, NeoForge versions start with the Minecraft version (26.1.0.x). Any crash report listsMinecraft VersionandJava Versionunder System Details. - Pick the Java that matches.
Minecraft version Java 26.1 and newer Java 25 1.20.5 to 1.21.11 Java 21 1.18 to 1.20.4 Java 17 1.17.x Java 16 1.16.5 and older Java 8 Use the version in the table, not the newest Java you can find. Newer Java often works on 1.18+ packs, but it isn’t guaranteed. Forge for 1.12.2 and older won’t start on anything newer than Java 8. Mojang raises the requirement now and then, so for a release newer than this page, check its release notes. Our Minecraft Java version chart has the same table with loader notes, and the Java for every modpack we have a guide for.
- Check whether a mod is the real problem.
If the error asks for more Java than the table gives your Minecraft version, upgrading Java usually isn’t the fix. Example: class file version 65 (Java 21) on a 1.20.1 pack. That usually means a mod built for a newer Minecraft version is in your
mods/folder. The class name in the error usually gives it away, because the package (com/author/modname/...) names the mod. Replace it with the file for your exact Minecraft version and loader from CurseForge or Modrinth.The ASM error often doesn’t name a class. Check the lines just above it, or remove recently added mods until it starts.
- Switch Java.
- Pelican or Pterodactyl panel (DSN uses Pelican): open the Startup tab, pick the matching Java from the Docker Image dropdown, then restart. Your files don’t change. If the dropdown has only one choice, ask your host to switch it.
- Docker with
itzg/minecraft-server: use the matching tag, such as:java25,:java21,:java17or:java8. - Your own PC or VPS: install the version you need (Eclipse Temurin, or packages like
openjdk-21-jre-headlesson Ubuntu).java -versionshows whatjavapoints to. On Debian or Ubuntu,sudo update-alternatives --config javachanges the default, or put the full path to the rightjavain your start script.
- Loader notes.
- Forge 1.17+ and NeoForge normally start from
run.shorrun.bat, which call whateverjavais first on the PATH. The scripts don’t check its version. If that’s Java 8, you get the@user_jvm_args.txterror. With several Java installs, replace thatjavawith a full path.user_jvm_args.txtholds JVM flags such as memory; it can’t choose the Java version. - Forge 1.16.5 and older start with
java -jaron the Forge jar. Use Java 8. - Fabric and Quilt start from a launcher jar with
java -jar. Mods can declare the Java they need infabric.mod.json(for example"java": ">=21"), which Quilt also reads. Then the loader stops with a dependency error instead of a crash. On Fabric it says the mod requires “version 21 or later” of your Java, listed with the ID(java). Same fix: newer Java if your Minecraft version calls for it, otherwise the right version of that mod.
- Forge 1.17+ and NeoForge normally start from
How to check it’s fixed
- Start the server and watch the console. A good start ends with
Done (12.345s)! For help, type "help". - Confirm the Java version. Run
java -versionthe same way your start script calls Java, or check the image name on the Startup tab. - Same error with a different class name? Another mod is built for the wrong version. Repeat step 3.
- A different error means Java is sorted and you’ve reached a separate problem. That’s progress.
latest.log and explains the fix. Free, no sign-up.Related crash guides
- Wrong mod loader or Minecraft version — a Fabric mod on Forge, or a mod made for another Minecraft version.
- Missing mod dependency — “requires mod” and “Missing or unsupported mandatory dependencies”.
- Mixin errors — “Mixin apply failed” and
InvalidInjectionException. - Client-only mod on a server — “invalid dist DEDICATED_SERVER”.
- Which Java version does my Minecraft server need? — the chart by Minecraft version, how to switch, and the Java for each modpack.
Modded hosting where Java is a dropdown.
On a DSN server you switch Java on the Startup tab and install Forge, NeoForge, Fabric or a CurseForge or Modrinth pack in one click. We're moving DSN Servers to new hardware, and ordering is closed until then. Join the launch list and we'll email you when servers open.