Which Java version does Minecraft need?
Every Minecraft server release is built against a specific Java version, and a server refuses to start on anything older. Since Minecraft 26.1 (March 2026) that version is Java 25. A newer Java runs older servers fine, so Java 25 is the right install even if you also run a 1.21 server.
| Minecraft version | Java required |
|---|---|
| 26.1 and newer (2026 releases) | Java 25 or newer |
| 1.20.5 to 1.21.11 | Java 21 or newer |
| 1.18 to 1.20.4 | Java 17 or newer |
| 1.17 to 1.17.1 | Java 16 or newer |
| 1.16.5 and older | Java 8 (most builds) or Java 11 |
This guide installs Eclipse Temurin 25, the free OpenJDK build from the Adoptium project. It is a long-term support release, it is what most hosting companies run, and the installers do the PATH setup for you. Microsoft's OpenJDK 25 build, which Mojang tests against, works just as well.
Step 1: Check which Java you have
Open Command Prompt, PowerShell, or Terminal and run:
java -versionThe first line shows the version. openjdk version "25.0.4" means you are done. A lower number, or an error such as java is not recognized or command not found, means you need to install.
Java from java.com is Java 8
Step 2: Install Java 25
Option A: the installer
Go to adoptium.net and download Temurin 25 (LTS), Windows, x64, JDK, as an .msi. Run it. On the "Custom Setup" screen, enable Set JAVA_HOME variable and make sure Add to PATH is enabled. Finish the wizard.
Option B: one command
Open PowerShell and run:
winget install EclipseAdoptium.Temurin.25.JDKwinget sets the PATH for you. Close and reopen the terminal afterwards.
Remove or demote older Java
If java -version still reports 21 or 17, an older install is first on the PATH. Open Settings → Apps → Installed apps, uninstall the older Java entries you no longer need, then reopen the terminal.
Step 3: Make Java 25 the default
Skip this step if java -version already reports 25. Otherwise an older Java is winning, and there are two ways to deal with it: switch the default, or point the start script at Java 25 directly.
Point the start script at Java 25
Instead of fighting the PATH, use the full path in start.bat. The Temurin installer puts Java under C:\Program Files\Eclipse Adoptium:
@echo off
"C:\Program Files\Eclipse Adoptium\jdk-25.0.4.7-hotspot\bin\java.exe" -Xms2G -Xmx2G -jar server.jar nogui
pauseCheck the exact folder name in File Explorer, the build number changes with updates.
Step 4: Verify and start the server
Open a new terminal window and run:
java -versionThe first line should read openjdk version "25 followed by the build number. Then start the server with your normal script. A 26.x server prints Starting minecraft server version 26.2 and eventually Done. If you have not set up a server yet, the full setup tutorial continues from here.
Common errors and what they mean
UnsupportedClassVersionError, class file version 69.0
The server jar was compiled for Java 25 (class file version 69) and an older Java tried to run it. Java 21 is version 65, Java 17 is 61. Go back to Step 3: the start script or the PATH is picking up the old version.
'java' is not recognized as an internal or external command
Windows cannot find Java on the PATH. Re-run the Temurin installer and enable the PATH option, or use the full path in start.bat as shown in Step 3. Always open a new terminal after installing.
Bad CPU type in executable (macOS)
An x64 Java was installed on an Apple silicon Mac without Rosetta, or the other way round. Install the aarch64 build on M-series Macs. The Homebrew cask picks the right one.
Minecraft says "Java is not installed" while launching the client
The client and the server use different Java installs. The Minecraft launcher downloads its own runtime, so a client problem is unrelated to the server Java, and installing Java 25 does not change the client. Repair the launcher installation from its settings.
Frequently asked questions
Do I need Java 25 for Minecraft 1.21?
No. Minecraft 1.20.5 through 1.21.11 need Java 21 or newer. Java 25 runs those versions too, so installing 25 covers both old and new servers.
JDK or JRE?
Either runs a Minecraft server. The JDK is the full development kit, the JRE is the runtime only. On a dedicated Linux server the headless JRE package is the smallest install. On a desktop, the JDK installers from Adoptium are the simplest choice.
Is Eclipse Temurin free? What about Oracle Java?
Temurin is free and open source under the GPL with Classpath Exception, and it is the build most Minecraft hosts use. Oracle's JDK has its own license. The Java from java.com is Java 8, which cannot run any modern Minecraft server.
Can I keep Java 21 installed alongside Java 25?
Yes. Both can coexist. The one that runs when you type java is whichever comes first on the PATH, or the one selected with update-alternatives on Linux or java_home on macOS. A start script can also point at a specific Java by full path.
Can the Minecraft launcher's built-in Java run the server?
The launcher downloads its own runtime for the client, and it can be used by pointing the start script at that java binary. It is not on the PATH and it changes when the launcher updates, so a normal system install is more reliable.
Related guides
How to Update a Minecraft Server to 26.2 (from 1.21 or 26.1)
The safe order for a 26.2 upgrade, what changed since 1.21, and how to roll back.
Read the guideMinecraft Server Port Forwarding: Open Port 25565 on Any Router
Open port 25565, test it, fix the usual failures, or skip it with a tunnel.
Read the guide