How to fix UnsupportedClassVersionError in Minecraft

The game, a mod or the server was built for a newer version of Java than the one you're running it with. The fix is to run it with the right Java.

Updated 2026-09-26

What the error says

java.lang.UnsupportedClassVersionError: net/minecraft/server/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

The two numbers are Java versions in disguise. The first says what the file needs, the second what you have. Subtract 44 from each: 65 is Java 21, and 61 is Java 17. So this file needs Java 21 and is being run with Java 17.

Class file versionJava version
52.0Java 8
55.0Java 11
60.0Java 16
61.0Java 17
65.0Java 21
69.0Java 25

Which Java each game version needs

Minecraft versionJava version
1.16.5 and olderJava 8
1.17Java 16
1.18 to 1.20.4Java 17
1.20.5 to 1.21.xJava 21
26.1 and newerJava 25

Each of these means that version or newer. A mod or plugin can ask for a newer Java than the game does, so if the game itself starts and the error names a mod, check what the mod's page says.

Check which Java you're running

Open a terminal and run:

java -version

The first line says the version, like openjdk version "21.0.5". On a computer with several Javas installed, the terminal may pick a different one than the launcher does, so check the one that actually starts the game.

Fix it in a launcher

The Minecraft Launcher brings its own Java, so you rarely see this error there. Other launchers let you pick one. In Prism Launcher, open the instance's settings, go to Java, and choose an installation that matches the table above, or let it download one. If you use a modpack, use the Java version its page asks for.

Fix it on a server

  1. Install the Java version the table shows for your Minecraft version.
  2. Run java -version again and make sure it prints the new one. If it doesn't, start the server with the full path to the new Java, like /usr/lib/jvm/java-21-openjdk/bin/java -jar server.jar nogui.
  3. On a hosting panel, look for a Java version setting or startup image and pick the right one.

The other direction can fail too. Old versions may not run on the newest Java, especially heavy modpacks, so use the version the game asks for, not the biggest number.

Send the log

If you're not sure which file is the problem, send latest.log. Drop it onto minelog for a link. The Analyze menu on a saved log shows the Java version the log itself reports.

Questions

What does class file version 65.0 mean?

The file was built for Java 21. Subtract 44 from the class file version to get the Java version.

Which Java does Minecraft 1.21 need?

Java 21 or newer. Minecraft 1.20.5 and later need Java 21, and 26.1 and later need Java 25.

Can I keep several Java versions installed?

Yes. Most launchers let each instance pick its own. For a server, start it with the full path to the Java you want.

Keep reading

Share a log