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.