Game Servers

Fix Minecraft "UnsupportedClassVersionError" (Wrong Java Version)

UnsupportedClassVersionErrorcompiled by a more recent version of Javaclass file version
5 min read Updated 12 June 2026 ESAGAMES Team

This error means your server jar needs a newer Java than the one running it. Modern Minecraft needs modern Java — here's how to match them.

What the error means

UnsupportedClassVersionError ... compiled by a more recent version of the Java Runtime means the server jar was built for a newer Java than you have installed. The fix is simply installing and using the right Java version.

Which Java does my Minecraft need?

  • Minecraft 1.20.5+ / 1.21 — Java 21.
  • Minecraft 1.18 – 1.20.4 — Java 17.
  • Minecraft 1.17 — Java 16.
  • Minecraft 1.16.5 and older — Java 8.

Install the right Java

Install a modern JDK (Temurin/Adoptium is a good choice), then verify the version:

# Debian/Ubuntu example
apt install temurin-21-jdk
java -version   # should report 21

Point the server at it

If you have several Java versions, call the right one explicitly in your start script instead of the system default:

/usr/lib/jvm/temurin-21-jdk/bin/java -Xmx4G -jar server.jar nogui
Older modpacks want Java 8

Running an old 1.12 modpack? It needs Java 8 — newer Java will break it. Match Java to the Minecraft version, not "newest is best".

The jar needs newer Java than you have. Match Java to the Minecraft version (1.21 needs Java 21) and call it explicitly in the start script.

Java handled automatically

Our Minecraft hosting runs the correct Java for your version out of the box — one-click setup, protected in Frankfurt.

Minecraft hosting
FAQ

Frequently asked questions

What Java version does Minecraft 1.21 need?

Java 21. Minecraft 1.20.5 and newer require Java 21; 1.18–1.20.4 need Java 17; 1.17 needs 16; and 1.16.5 or older run on Java 8.

What causes "UnsupportedClassVersionError"?

The server jar was compiled for a newer Java than the one running it. Install the Java version that matches your Minecraft version and start the server with it.

Can I just install the newest Java for everything?

No — older versions and old modpacks (e.g. 1.12) need Java 8 and break on newer Java. Always match the Java version to the Minecraft version you're running.

Knowledge base

Related articles

Skip the troubleshooting

Managed, protected hosting in Frankfurt — we handle the Linux, the network and the DDoS so you don't have to.

Payments Secure checkout with cards, banking apps and digital wallets.

Choose the payment flow that fits your stack and region without leaving the platform.

Pay by Zen Visa Mastercard Paysafecard PaysafeCash Skrill Trustly Bancontact UnionPay iDeal WebMoney