Which Java version does a Minecraft server need?
A Minecraft server runs on Java, and newer server versions need newer Java. If Java is too old, the server won’t start and the log shows UnsupportedClassVersionError.
Java version table
When you play, the official launcher downloads the right Java for you. A server is different, and you have to provide Java yourself. The server’s Minecraft version sets the minimum Java version. For example, 26.1 and later need Java 25, so the Java 21 that ran your 1.21 server won’t start it.
| Minecraft version | Minimum Java | Class file version |
|---|---|---|
| 1.12 to 1.16.5 | Java 8 | 52 |
| 1.17 to 1.17.1 | Java 16 | 60 |
| 1.18 to 1.20.4 | Java 17 | 61 |
| 1.20.5 to 1.21.11 | Java 21 | 65 |
| 26.1 and later | Java 25 | 69 |
For versions older than 1.12, such as 1.8.9, the official launcher also uses Java 8. Modded servers are pickier, and an older modpack may only start on Java 8 or 17. If the modpack names a Java version, use that version.
The error when Java is wrong
Start the vanilla 26.3 server.jar with Java 21 and the server stops right away. These two lines appear in the console.
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 69.0), this version of the Java Runtime only recognizes class file versions up to 65.0The message has two numbers. Class file version 69.0 is what the jar needs, and “up to 65.0” is the newest your current Java can read. In the version table, class 69 is Java 25 and 65 is Java 21, so switch to Java 25.
With Paper or another server software, the class name in the message changes, but you read the numbers the same way. If the class name belongs to a plugin or mod, that plugin needs a newer Java and the server version itself is fine.
Changing Java on your own server
Run this in Command Prompt or a terminal to see which Java your computer uses by default.
java -versionThe number on the first line is the Java version. For example, 25.0.1 is Java 25. Java 8 uses an older format and shows up as 1.8.0_ followed by an update number.
If the version is too old, download the one you need from an OpenJDK distribution’s website, or install it with your Linux package manager. A Minecraft server only needs a JRE. A JDK adds development tools and works just as well.
With several Java versions installed, the java command points to only one of them. To pin a server to a specific version, replace java in your start.bat with the full path to that version’s java executable. If Java 25 is installed in C:\Program Files\Java\jdk-25, the command looks like this. The actual folder name depends on the distribution you installed.
"C:\Program Files\Java\jdk-25\bin\java.exe" -Xms2G -Xmx4G -jar server.jar noguiChanging Java in vPanel
On vProxy Cloud Minecraft servers, pick the Java version under Runtime in Startup. The screenshot at the top of this guide shows a 1.21.4 server with Java 21 selected, which matches the table. The change saves automatically and takes effect on the next start, so restart the server from the Console afterwards.
When you change the Minecraft version or server software with the Version installer, the install summary lists the Java version it needs and switches Java during the install. If you change the Minecraft version in Startup yourself or upload a different jar, check Runtime against the version table.
References
- Java Edition 1.17 Minecraft Wiki
- Java Edition 1.18 Minecraft Wiki
- Java Edition 1.20.5 Minecraft Wiki
- Java Edition 26.1 Minecraft Wiki