setupmc.com

Determining the Correct Java Version for Operating a Minecraft Server

If you want to set up a Minecraft server, you may encounter an error message related to the Java version when starting the server. In this article, you will learn how to determine the correct Java version for your Minecraft server.

Getting Started & Choices
setupmc.com Team

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

Why is the correct Java version important?

When setting up a Minecraft server, you may receive an error message indicating an incompatible Java version. This happens when the Minecraft server software has been compiled with a newer Java version than your current runtime environment supports. In this article, you will learn how to determine and install the correct Java version.

Typical Error Message

An example of such an error message:

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

This message means that your installed Java version does not match the version required by the Minecraft server. The solution is to update to the appropriate Java version.

Determine the required Java version

Each Java version has its own Class File Version, which indicates which Java version is required to run it. For a direct result, paste the complete startup message into our Minecraft Java Version Checker. It extracts both the required and currently recognized class-file versions and suggests a pinned Docker image. The following table shows the mapping:

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 4
47.0Java 3
46.0Java 2
45.3Java 1.1

If your server shows the error message with Class File Version 69.0, you need at least Java 25.

For current Paper versions, the practical compatibility table is shorter than the full class-file table:

Paper / Minecraft versionRequired or recommended Java version
26.1 and newerJava 25
1.20 through 1.21.11Java 21
1.17 through 1.19Java 17

Older modpacks can impose stricter requirements. The Minecraft version alone is not enough: check the requirements of the mod loader and the exact modpack release as well.

Check Docker image tag for itzg/minecraft-server

If you are running the Minecraft server in Docker, you may be using the image itzg/minecraft-server. This image has various tags with different Java versions. At the time of this update, both latest and stable use Java 25. The moving tags can change again when Mojang raises the Java baseline.

For a current Paper server, a deliberate Compose setting looks like this:

services:
  mc:
    image: itzg/minecraft-server:java25
    environment:
      EULA: "TRUE"
      TYPE: PAPER
      VERSION: "26.1"

If you use an older modpack, pin the Java tag it actually supports instead of assuming that the newest runtime is compatible. After changing the tag, pull and recreate the container:

docker compose pull mc
docker compose up -d mc
docker compose logs -f mc

A list of available tags can be found in our Configurator for Minecraft: Java Edition Server with Docker. Import your compose.yml, select the appropriate image tag, and update your file accordingly.

Check Java version on your system

If you are running your Minecraft server without Docker, you can check your current Java version with the following command in PowerShell (Windows) or Terminal (macOS/Linux):

java -version

If the installed version is not sufficient, you can install a newer version.

To install Java 25, use the following instructions:

  • Windows: Download a Java 25 JDK from Adoptium and select the 64-bit package for your system.
  • macOS: Install a Java 25 JDK with your preferred package manager, for example brew install openjdk@25, and follow Homebrew's linking instructions.
  • Linux: Follow the current Paper Java installation guide or install a Java 25 JDK from your distribution or Adoptium.

Run java -version again after installation and confirm that the shell resolves the intended runtime.

If you run a Docker-based server, adjust the image tag instead of changing the host runtime blindly. That is especially relevant when an older mod stack still requires Java 17 or 21 while current Paper releases have moved to Java 25.

Conclusion

The correct Java version is crucial for the error-free operation of a Minecraft server. If you receive an UnsupportedClassVersionError, check the required Java version based on the Class File Version and update your installation accordingly.

By using the appropriate Java version or a suitable Docker image, you can start and run your server without any issues.

Next steps

Frequently asked questions

Short answers to the questions that usually come up while working through this topic.