← Back to Knowledgebase
Fixing Java Version Errors
How to resolve "has been compiled by a more recent version of the Java Runtime" errors.
The Error
If your console says something like:
Exception in thread "main" java.lang.UnsupportedClassVersionError: ... has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 52.0
This means your server JAR requires a newer version of Java than what the server is currently using.
Required Java Versions
- Minecraft 1.20.5+: Requires Java 21.
- Minecraft 1.18 - 1.20.4: Requires Java 17.
- Minecraft 1.17: Requires Java 16.
- Minecraft 1.16 and below: Requires Java 8 or Java 11.
How to Change Java Version
- Go to the "Startup" tab in your panel.
- Look for the "Docker Image" or "Java Version" setting.
- Select the appropriate version from the dropdown (e.g.,
ghcr.io/pterodactyl/yolks:java_21 for Minecraft 1.21).
- Restart your server.
Still not working?
If you changed the version but still get the error, verify that you are not manually specifying a Java path in your Startup Command. Ensure the command just uses java -Xms....