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.0The 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 version | Java version |
|---|---|
| 52.0 | Java 8 |
| 55.0 | Java 11 |
| 60.0 | Java 16 |
| 61.0 | Java 17 |
| 65.0 | Java 21 |
| 69.0 | Java 25 |
Which Java each game version needs
| Minecraft version | Java version |
|---|---|
| 1.16.5 and older | Java 8 |
| 1.17 | Java 16 |
| 1.18 to 1.20.4 | Java 17 |
| 1.20.5 to 1.21.x | Java 21 |
| 26.1 and newer | Java 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 -versionThe 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
- Install the Java version the table shows for your Minecraft version.
- Run
java -versionagain 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. - 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.
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
- How to read a Minecraft crash reportA crash report looks like a wall of text, but the answer is usually in three places. Learn what Description, the stack trace and Caused by lines mean.
- How to find your Minecraft logsFind latest.log and crash reports for the Minecraft client, servers and launchers like Prism and Modrinth App. Paths for Windows, macOS and Linux.