Roastd / Minecraft

critical

Java is too old for this Minecraft version

What it looks like in your log

java.lang.UnsupportedClassVersionError: net/minecraft/server/Main has been compiled by a more recent version of the Java Runtime

What causes it

This Minecraft version needs a newer version of Java than the one installed.

How to fix it

Install the latest Java from adoptium.net, then start the server again.

Why it happens

The installed Java is older than what the server jar, a plugin or a mod was compiled for. Minecraft moved its requirement three times in recent years: 1.17 needs Java 16, 1.18 through 1.20.4 need Java 17, 1.20.5 and later need Java 21. Anyone who installed Java once and never again eventually hits this on the first server update after the line moved.

Fix it step by step

  1. 1Check what is installedjava -version in a terminal, or the first lines of the server log, show the version running.
  2. 2Install the Java the game needsJava 21 for 1.20.5 and later, Java 17 for 1.18 to 1.20.4, Java 8 for anything before 1.17. Adoptium has all of them.
  3. 3Point the server at itA panel has a Java version setting. A start script needs the new java on PATH or called by full path.
  4. 4Restart and confirmThe log should now show the new version and the server should pass the point where it died.

If that didn't work

If the game jar loads but a plugin fails with this error, the plugin was built for a newer game version. Match the plugin build to the server.

Not sure this is your problem? Paste your log and Roastd will tell you which of these it actually matched, and what else it found.

Check your own log
Read more: UnsupportedClassVersionError →

Errors that travel with this one