Knowledgebase

Install Java 21 on Debian 12

You want to install Java 21 on your Debian 12/11/10 operating system? Then you're in the right place!

First, it's important to update the package list of your Debian system and install any possible updates. You can do this with a simple command:

apt update && apt upgrade -y

 

If you want to install Java 21 on Debian 12/11/10, you can do so with a simple command:

wget https://download.oracle.com/java/21/latest/jdk-21_linux-x64_bin.deb
sudo dpkg -i jdk-21_linux-x64_bin.deb

 

Check if the installation was successful:

It's important that you also check if the installation was successful at the end. You can easily check this by querying the Java version.

java -version

If you see your desired Java version here, the installation was successful.

 

If you see a different Java version, you might need to set the default Java version. You can list your Java versions with the following command:

sudo update-alternatives --list java

 

To set Java 21 as the default Java version, simply select the Java 21 version from the list. An example would be as follows:

sudo update-java-alternatives --set  /usr/lib/jvm/jdk-21-oracle-x64

 

Now you can check the Java version again:

java -version

If you see your desired Java version here, the installation was successful.

 


 

Do you have a vServer / root server and would like to have more performance? Then a look at our range of root servers couldn't hurt!

With the discount code "KernelHost-Tutorials" you also receive a 10% discount (permanent) on your tariff!

More details:

Hardware: https://www.kernelhost.com/en/hardware

Datacenter: https://www.kernelhost.com/en/datacenter

DDoS-Protection: https://www.kernelhost.com/en/ddos-protection

PrePaid: https://www.kernelhost.com/en/prepaid

Didn't the instructions help you? You can contact us here via ticket! We're here to help.

 

© KernelHost.com - Re-posting these instructions on your website is not permitted.

  • 1 Users Found This Useful

Was this answer helpful?

Related Articles

[Debian 8 (Jessie)] Update über apt-get update schlägt fehl

Sie wollen Ihren Server mit Debian 8 updaten, und das schlägt fehl? Dann sind Sie hier genau...

Mail-Server (modoboa) auf Debian 11 & Debian 10 installieren

Sie möchten gerne einen eigenen Mailserver auf Ihren Debian 10 / Debian 11 Server installieren?...

MySQL | Apache2, PHP8, MySQL und PHPMyAdmin auf Debian 11 & Debian 10 installieren

Sie möchten gerne Apache2, PHP8, MySQL (bzw. MariaDB) und PHPMyAdmin (LaMp) auf Ihrem Debian 10 /...

NodeJS-10 / NodeJS-12 auf Debian 11 & Debian 10 installieren

Sie möchten gerne NodeJS und npm auf Ihren Debian-10 / Debian 11 Server installieren? Dann sind...

Backup MySQL databases daily on Debian

You own a Debian OS at your VPS / VDS / dedicated server and want to automatically daily secure...