Direct answer

Install a 64-bit OpenJDK build that matches your server software, then confirm it with java -version. For Paper, the current documentation recommends Java 21 for Paper 1.20 through 1.21.11 and Java 25 for Paper 26.1 and newer.

Paper Java version table

Paper versionRecommended Java
1.17–1.19Java 17
1.20–1.21.11Java 21
26.1+Java 25

Older Minecraft lines may require older Java releases. If you are running an old server, use the version table in Paper's current documentation instead of guessing.

Verify the Java your terminal is using

java -version

Look for the major version and a 64-bit runtime. If the terminal says Java is not found, open a new terminal after installation. If multiple Java versions are installed, the java command may still point at an older one.

What UnsupportedClassVersionError means

An UnsupportedClassVersionError usually means the JAR was compiled for a newer Java version than the Java runtime you launched it with. Updating the Java used by the start script is normally the correct fix; changing random server files is not.

JDK or JRE?

A full OpenJDK installation is a simple choice for server owners and avoids missing tooling. Paper's Java installation guide currently uses Amazon Corretto as one example, while also noting alternatives such as Eclipse Adoptium, Microsoft, and Azul Zulu.

Common mistake: the panel chooses Java for you

On a game host, Pterodactyl, PufferPanel, Docker image, or managed panel, the Java version may be selected by the server image rather than by the operating system. If java -version inside the server environment differs from your desktop installation, change the server image/runtime setting instead.

Prove which Java executable launches the server
  1. Run java -version in the exact terminal or hosting startup environment that launches the server; Java installed elsewhere on the machine may not be the one your panel runs.
  2. If several versions are installed, use an explicit executable path in the start script instead of guessing based on system-wide PATH.
  3. Match the Minecraft/server JAR’s required Java major version. A newer Java release is not automatically supported by every old mod loader or plugin.

Official references

These references were checked while preparing this guide. Version-specific behavior can change, so use the project documentation for your exact release when a detail differs.

Was this article helpful?
Help us improve this article

Tell us what is missing, unclear, outdated, or incorrect. You can also suggest something we should add.

What could we improve?
Do not include passwords, server IPs, or other private information.0 / 1000