setupmc.com

Minecraft Java version: Java 25, 21, 17 and class-file errors

Find the Java version for your Minecraft server. Fix class-file errors 69.0, 65.0 and 61.0 and choose the right itzg Docker image tag.

Getting Started & Choices
setupmc.com Team

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 versionJava version
69.0Java 25
68.0Java 24
67.0Java 23
66.0Java 22
65.0Java 21
64.0Java 20
63.0Java 19
62.0Java 18
61.0Java 17
60.0Java 16
59.0Java 15
58.0Java 14
57.0Java 13
56.0Java 12
55.0Java 11
54.0Java 10
53.0Java 9
52.0Java 8
51.0Java 7
50.0Java 6
49.0Java 5
48.0Java 1.4
47.0Java 1.3
46.0Java 1.2
45.3Java 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.

Use the matching tool

Java version checker

Find the correct Java runtime and Docker image from a Minecraft version or startup error.

Open Java version checker

Frequently asked questions