🇬🇧 English
🇬🇧 English
Appearance
🇬🇧 English
🇬🇧 English
Appearance
This page is written for version:
1.21.4
This guide will walk you through installing Java 21 on Linux.
Open a terminal, type java -version, and press Enter.

WARNING
To use Minecraft 1.21, you'll need at least Java 21 installed. If this command displays any version lower than 21, you'll need to update your existing Java installation.
We recommend using OpenJDK 21, which is available for most Linux distributions.
INFO
For more information on installing Java on Arch Linux, see the Arch Linux Wiki.
You can install the latest JRE from the official repositories:
sudo pacman -S jre-openjdkIf you're running a server without the need for a graphical UI, you can install the headless version instead:
sudo pacman -S jre-openjdk-headlessIf you plan to develop mods, you'll need the JDK instead:
sudo pacman -S jdk-openjdkYou can install Java 21 using apt with the following commands:
sudo apt update
sudo apt install openjdk-21-jdkYou can install Java 21 using dnf with the following commands:
sudo dnf install java-21-openjdkIf you don't need a graphical UI, you can install the headless version instead:
sudo dnf install java-21-openjdk-headlessIf you plan to develop mods, you'll need the JDK instead:
sudo dnf install java-21-openjdk-develIf your distribution isn't listed above, you can download the latest JRE from Adoptium
You should refer to an alternative guide for your distribution if you plan to develop mods.
Once the installation is complete, you can verify that Java 21 is installed by opening a terminal and typing java -version.
If the command runs successfully, you will see something like shown before, where the Java version is displayed:
