Which Java Version Does My Minecraft Server Need?

Updated · MCJarHub

It depends on the Minecraft version: Mojang raised the minimum over time, from Java 8 (up to 1.16.5) to Java 16 (1.17), Java 17 (1.18–1.20.4), Java 21 (1.20.5–1.21.11) and Java 25 (26.x). The server needs that Java version or newer; the table below is generated from Mojang's own version data.

Minecraft version → required Java version

Generated from Mojang's version data (the javaVersion Mojang publishes for every release). "Java 21" means Java 21 or newer.

Minecraft releasesMinimum JavaClass fileDownload
26.1 – 26.3 (5 releases) Java 25 69 Temurin 25
1.20.5 – 1.21.11 (14 releases) Java 21 65 Temurin 21
1.18 – 1.20.4 (13 releases) Java 17 61 Temurin 17
1.17 – 1.17.1 (2 releases) Java 16 60 Temurin 16
1.2.5 – 1.16.5 (63 releases) Java 8 52 Temurin 8

Snapshots, pre-releases and release candidates follow the release they lead up to; each snapshot page shows its exact requirement. Server software built on a Minecraft version (Paper, Purpur, Spigot, Fabric, Forge, NeoForge…) needs at least the same Java as that Minecraft version.

Pick your Java version

Detailed pages with install commands for Windows, macOS and Linux: Java 25 · Java 21 · Java 17 · Java 16 · Java 8

Class file versions (for error messages)

Errors like UnsupportedClassVersionError … class file version 65.0 … only recognizes class file versions up to 61.0 name Java versions by their class file number. The first number is what the jar needs, the second is what your Java supports.

Class file versionJava version
69.0Java 25
65.0Java 21
61.0Java 17
60.0Java 16
55.0Java 11
52.0Java 8

Java 11 is listed because it appears in error messages from older tools and plugins; no vanilla Minecraft release requires exactly Java 11. Full walkthrough: fix UnsupportedClassVersionError.

Check which Java you have

Run this in a terminal (Command Prompt or PowerShell on Windows, Terminal on macOS/Linux):

java -version

The first line shows the major version: openjdk version "21.0.8" is Java 21; Java 8 reports itself as 1.8.0_…. To see everything installed: dir "C:\Program Files\Eclipse Adoptium" (Windows), /usr/libexec/java_home -V (macOS) or ls /usr/lib/jvm (Linux).

Point your start script at a specific Java

With several Java versions installed, java means whichever one comes first on your PATH. Calling Java by its full path in the start script removes the guesswork — useful when one machine runs a 1.12.2 modpack on Java 8 and a 26.x server on Java 25.

REM Windows (start.bat) — Temurin installs to C:\Program Files\Eclipse Adoptium\
"C:\Program Files\Eclipse Adoptium\jdk-21.0.8.9-hotspot\bin\java.exe" -Xms4G -Xmx4G -jar server.jar nogui

# macOS (start.sh)
"$(/usr/libexec/java_home -v 21)/bin/java" -Xms4G -Xmx4G -jar server.jar nogui

# Linux (start.sh) — Adoptium .deb packages install to /usr/lib/jvm
/usr/lib/jvm/temurin-21-jdk-amd64/bin/java -Xms4G -Xmx4G -jar server.jar nogui

Adjust folder names to what you actually have installed. The start script generator creates scripts that also check the Java version before starting.

Proxies, modded and Bedrock servers

  • Proxies are not tied to a Minecraft version. Velocity's requirement comes from PaperMC per Velocity version and is shown on each Velocity page.
  • Old modded servers (Forge 1.16.5 and older) generally expect Java 8 rather than "8 or newer"; check the loader's requirements before upgrading Java.
  • Bedrock servers differ: PocketMine-MP runs on PHP, not Java, and Mojang's Bedrock Dedicated Server is a native program.

FAQ

Can I use a newer Java than the minimum?
Usually yes for vanilla and Paper-family servers: "Java 21" means Java 21 or newer. Old modded setups are the exception — Forge for 1.16.5 and earlier generally expects Java 8, so check your loader's requirements before upgrading Java.
Do I need the JDK or is the JRE enough?
A server only needs a Java runtime (JRE). Installing the JDK is also fine and is what most package managers offer; it includes the runtime.
Does the Minecraft launcher's bundled Java help my server?
No. The launcher ships its own Java for the game client only. A dedicated server uses whatever java your start script calls, so install a system Java or point the script at a specific one.