Choose Java for the exact server release
Paper 26.1 and newer requires Java 25. For older Paper releases, Paper recommends Java 21 for 1.20–1.21.11 and Java 17 for 1.17–1.19. These are Paper's version recommendations, not a compatibility promise for every Minecraft server.
For Vanilla, check the requirements of the Minecraft release. For Fabric, Forge, NeoForge or a modpack, also check the loader and exact pack release. A newer Java runtime is not always compatible with an older mod stack. Choose the documented supported version before installing Java or changing a Docker image.
Read a class-file version error
UnsupportedClassVersionError means that a loaded class was compiled for a newer Java version than the running JVM understands. The class can belong to the server, a plugin or a mod, so read the class name and the surrounding startup log too.
For example:
java.lang.UnsupportedClassVersionError: net/minecraft/bundler/Main has been compiled by a more recent version of the Java Runtime (class file version 69.0), this version of the Java Runtime only recognizes class file versions up to 65.0
The first number is the class's requirement; the second is the runtime's limit. Here, code requiring Java 25 is being started with Java 21.
| Class-file version | Java version |
|---|---|
69.0 | Java 25 |
68.0 | Java 24 |
67.0 | Java 23 |
66.0 | Java 22 |
65.0 | Java 21 |
64.0 | Java 20 |
63.0 | Java 19 |
62.0 | Java 18 |
61.0 | Java 17 |
60.0 | Java 16 |
59.0 | Java 15 |
58.0 | Java 14 |
57.0 | Java 13 |
56.0 | Java 12 |
55.0 | Java 11 |
54.0 | Java 10 |
53.0 | Java 9 |
52.0 | Java 8 |
51.0 | Java 7 |
50.0 | Java 6 |
49.0 | Java 5 |
48.0 | Java 1.4 |
47.0 | Java 1.3 |
46.0 | Java 1.2 |
45.3 | Java 1.1 |
Use a runtime that satisfies the requirement and supports the full server stack. If only a newly added plugin or mod fails, check whether you downloaded its build for the wrong Minecraft or Java version before upgrading the entire server.
Check the runtime that actually starts the server
Docker
Run these commands from the directory containing your Compose file, replacing mc with your service name:
docker compose logs --tail=100 mc
docker compose exec mc java -version
The second command requires a running container. If it exits immediately, check the first startup error in the logs and the image selected in your Compose file. Installing Java on the Docker host does not change Java inside the container.
Native server
In your terminal, run:
java -version
Find the executable with command -v java on Linux/macOS, or in Windows PowerShell:
Get-Command java | Select-Object -ExpandProperty Source
Then inspect the server's startup script, service or hosting panel. It may specify an absolute Java path or use a different PATH from your terminal. Check that executable's version as well; a successful terminal check alone does not prove the server uses it.
Fix the Docker image and recreate the container
For itzg/minecraft-server, select a tag with the required Java major version: for example, itzg/minecraft-server:java25 for a server requiring Java 25. The image's Java documentation lists the available tags and compatibility notes.
An untagged image uses latest. Moving tags can change their Java version, so select an explicit Java tag when your server or pack needs a particular runtime. A java25 tag fixes the Java major version, not the exact image build or Minecraft version.
Change only the image value in your existing Compose file and preserve your volumes, environment and other settings. Back up server data before making runtime changes, then pull and recreate the service:
docker compose pull mc
docker compose up -d mc
docker compose logs -f mc
Verify that startup completes, then repeat the container's java -version check. Restarting the old container alone does not apply the changed image. You can also import your Compose file into the Minecraft Docker Compose Generator to adjust the image tag.
Install the supported runtime for a native server
Download the required JDK from Adoptium for your operating system and CPU architecture, or follow Paper's Java installation instructions. Select the Java major version established above rather than automatically choosing the newest download.
On Windows, check the installer's PATH options and open a new terminal after installation. On macOS or Linux, follow the package's installation and path instructions. If several Java versions are installed, set the server startup command to the intended executable explicitly.
Stop the server, update its startup script or service, and start it again. Confirm the selected executable with java -version and check the new startup log. If the same class-file error remains, the server is likely still using a different runtime or an incompatible extension.
Check your version or paste the error
The Minecraft Java Version Checker accepts a Minecraft version or the complete class-file error. It identifies the required runtime and suggests an explicit Docker image tag; compare the result with any loader or modpack-specific requirements.
Once the Java error is resolved, continue with the Docker setup guide for a first deployment, or the port 25565 guide if the server starts but players cannot connect.