Install Java 21 in Debian 12

May 4th, 2024 – 11:50 pm
Categorized as Computing Note and tagged as , ,
Written by La Ecrivain

Minecraft Java edition lost compatibility with Java 17 between 1.20.4 and 1.20.6. Version 1.20.4 works with Java 17, and 1.20.6 no longer works with Java 17.  Several guides appear online for installing downloaded packages of the 64-bit runtime from Oracle or other sources.  Since Debian offers 32-bit server operating systems in the present day, the package manager versions are the easiest option if one uses the 32-bit version of Debian.  One of the reasons to use the 32-bit version of Debian is for use with older versions of Minecraft such as 1.10 and 1.12.  The older versions’ ecosystem contain an incredible number of mods.  The older versions require 32-bit java runtimes and the easiest way to handle that is to use a 32-bit operating system and then one can have newer versions of Java alongside older versions of Java and then one can run any version of Minecraft and Minecraft Forge that they desire.

Edit /etc/apt/sources.list to contain the following lines:

deb testing main
deb-src testing main

Then, run the following commands.

apt-get update
apt-get install openjdk-21-jre
java –version contains a good reference guide for using Debian Testing, including details on upgrading to the next distribution.  The approximate Java lifecycle can be found at