Unsupported Java Version

The server refuses to launch and reports a Java version error. Each Minecraft version is built for a specific Java release, and running the wrong one stops the server before the world ever loads.

What does this error mean?
Java class files carry a version number. When the server jar was compiled for a newer Java than the one installed, Java throws an UnsupportedClassVersionError (the classic 'Unsupported major.minor version' message). The opposite, too-new Java for an old server, can also break things.
Unsupported major.minor version
Most Common Causes
  • Minecraft 1.17+ needs Java 16+, 1.18-1.20.4 needs Java 17, and 1.20.5/1.21+ needs Java 21.
  • Older versions (1.16.5 and below) expect Java 8.
  • Multiple JDKs installed and the wrong one is first on PATH.
  • A hosting panel configured to launch with an outdated Java.
  • JAVA_HOME pointing at the wrong installation.
How To Diagnose
  1. Run 'java -version' to see what is actually being used.
  2. Check which Minecraft version you run and look up its required Java.
  3. Inspect your start script or panel setting for the java path it calls.
  4. On a panel, check the Java/Docker image version assigned to the server.
Recommended Fixes
  • Install the matching JDK
    Install the correct version (Eclipse Temurin is a solid free choice) for your Minecraft version.
  • Call Java explicitly
    Use the full path to the right java binary in your start script instead of relying on PATH.
  • Set the panel Java version
    On Pterodactyl or similar, select the Docker image with the correct Java release.
  • Fix JAVA_HOME
    Point JAVA_HOME at the right JDK so build tools and scripts pick it up.
Frequently Asked Questions

1.16 and older: Java 8. 1.17: Java 16+. 1.18-1.20.4: Java 17. 1.20.5 and 1.21+: Java 21.

Yes. Just make sure the start script points to the specific one your server needs.

Any modern OpenJDK build works. Temurin (Adoptium) is widely used and free for servers.