Skip to content

Java Version Issues

This guide helps you fix Java version errors on Minecraft servers, including crashes caused by mismatched Java versions.


Minecraft VersionRequired Java
1.21.xJava 21
1.20.xJava 21
1.18.x - 1.19.xJava 17
1.17.xJava 16 or 17
1.12.x - 1.16.xJava 8
1.7.x - 1.11.xJava 8

  1. Open your server in the control panel
  2. Go to the Console tab
  3. Look at the first few lines when the server starts

You’ll see something like:

Starting with Java 17...

or

[Server] Java Version: 21.0.1

  1. Go to your server in the control panel
  2. Click Startup in the sidebar
  3. Find Java Version or Docker Image dropdown
  4. Select the correct Java version for your Minecraft version
  5. Click Save (if applicable)
  6. Restart your server

ErrorMeaningFix
UnsupportedClassVersionErrorJava too old for the Minecraft versionUpgrade Java
java.lang.UnsupportedClassVersionError: ... has been compiled by a more recent versionSame as aboveUpgrade Java
Error: A JNI error has occurredJava version mismatchCheck and set correct Java
Exception in thread "main" followed by class version numbersJava incompatibilityMatch Java to your MC version

If you see an error like:

class file has wrong version 65.0, should be 61.0

The numbers map to Java versions:

  • 52 = Java 8
  • 61 = Java 17
  • 65 = Java 21

This error means your code needs Java 21 (65) but you’re running Java 17 (61).



Some Forge versions have specific requirements:

Forge + MC VersionJava Requirement
Forge 1.20.4+Java 21 required
Forge 1.18 - 1.20.1Java 17 required
Forge 1.17.xJava 16 or 17
Forge 1.16.x and olderJava 8 required

Fabric is generally more flexible with Java versions, but:

  • MC 1.20.5+ requires Java 21
  • MC 1.18+ works best with Java 17 or 21
  • Older versions work with Java 8

Check your Fabric loader’s requirements if you’re unsure.


Before contacting support, gather these 3 things:

  1. Server ID — found in your panel URL or dashboard
  2. What you tried — list the steps you already attempted
  3. Error message or screenshot — exact text or image of what you see

Then contact us: