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.

Updated 4 min read vProxy Cloud team

vPanel Startup settings (Chinese interface): the startup command java -Xms128M -XX:MaxRAMPercentage=95.0 … -jar server.jar at the top, Runtime set to Java 21, then the variables Build Number 232, Minecraft Version 1.21.4 and Server Jar File server.jar

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 versions, the minimum Java version and the class file version
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
Java versions run from oldest to newest, with the class file version after the word class.

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.0

The 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 -version

The 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 nogui

Changing 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

FAQ

Can I run an older server version on a newer Java?
Yes, though it may be less stable. The Minecraft Wiki gives 1.16 on Java 17 and 1.18 on Java 20 as examples, and warns that a Java version other than the one in the table can cause instability, especially for versions that need Java 8. If a modded server stops starting after the change, go back to the version in the table.
A plugin or mod needs a newer Java than my server. What now?
Switch to the Java version the plugin asks for, restart the server and check that UnsupportedClassVersionError no longer appears in the log. If the server itself won’t start on that Java, go back to the Java in the table and use a plugin or mod version that supports it.
Does a Bedrock server need Java?
No. The official Bedrock Edition server, Bedrock Dedicated Server, is a C++ program that runs on Windows and Linux without Java.

Start a Minecraft server

Taiwan from NT$99/mo, Singapore from NT$120Billed every 30 days