Tools
Which Java does a Minecraft server need?
Pick your server version to see which Java it needs according to PaperMC's table, how to check the one installed and how to install the right one on Linux, macOS and Windows.
Java version
Java 25 required
From PaperMC's table: 26.1+.
| Minecraft versions | Java |
|---|---|
| 26.1+ | Java 25 |
| 1.20 – 1.21.11 | Java 21 |
| 1.17 – 1.19 | Java 17 |
| 1.16.5 | Java 16 |
| 1.12 – 1.16.4 | Java 11 |
| 1.7.10 – 1.11 | Java 8 |
java -versionRun it in a terminal or command prompt: the first line of output is the Java version.
How to install Java 25
sudo apt-get update
sudo apt-get install ca-certificates apt-transport-https gnupg wget
wget -O - https://apt.corretto.aws/corretto.key | sudo gpg --dearmor -o /usr/share/keyrings/corretto-keyring.gpg && \
echo "deb [signed-by=/usr/share/keyrings/corretto-keyring.gpg] https://apt.corretto.aws stable main" | sudo tee /etc/apt/sources.list.d/corretto.list
sudo apt-get update
sudo apt-get install -y java-25-amazon-corretto-jdk libxi6 libxtst6 libxrender1sudo rpm --import https://yum.corretto.aws/corretto.key
sudo curl -Lo /etc/yum.repos.d/corretto.repo https://yum.corretto.aws/corretto.repo
sudo dnf -y install java-25-amazon-corretto-develbrew install openjdk@25Windows: download the Amazon Corretto installer from Amazon's site and run it — PaperMC says it's safe to click Next all the way. In Pterodactyl, pick Java on the Startup tab, in the Docker Image list.
PaperMC's Java install guideJava and your server version
A Minecraft server is a Java program, and each game version needs its own Java. Per PaperMC's table: 26.1 and newer — Java 25, 1.20–1.21.11 — Java 21, 1.17–1.19 — Java 17, 1.16.5 — Java 16, 1.12–1.16.4 — Java 11, 1.7.10–1.11 — Java 8. The Velocity proxy requires Java 25.
If Java is older than required, the server won't start and the console shows UnsupportedClassVersionError. A machine can have several Javas installed — then put the full path to the right one in your start script instead of plain java.
PaperMC recommends Amazon Corretto builds — the commands from its guide are above. After installing, check java -version, and build a start script with Aikar's flags in the start script generator.
DGuard runs on Paper and Leaf 1.21–26.3. The main version is 1.21.11: it's tested on it and running on live servers.
Read in the knowledge base
FAQ
Which Java does Minecraft 1.21 need?
Java 21: in PaperMC's table that covers 1.20 through 1.21.11.
Which Java does Minecraft 26.1 need?
Java 25 — for 26.1 and everything newer. A 26.x server won't start on Java 21.
How do I see which Java is installed?
Run java -version in a terminal or command prompt. The first line of output is the version number.
Can an old server version run on a newer Java?
Not always: old versions may not work on a much newer Java. It's safer to use the one PaperMC's table lists for your version.
The tools are free. So is anti-cheat protection
DGuard — the best anticheat for a modern Minecraft server — catches all 47 cheat types in our comparison; the nearest rival, Intave, catches 27. Free up to 30 players online, with the same protection as on paid plans.