← 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

How to Change Java Version

  1. Go to the "Startup" tab in your panel.
  2. Look for the "Docker Image" or "Java Version" setting.
  3. Select the appropriate version from the dropdown (e.g., ghcr.io/pterodactyl/yolks:java_21 for Minecraft 1.21).
  4. 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....