In this blog article I'll show you how to install Java 16 on Debian 10.
Now let's run the following command:
- Update the server:
root@testserver ~ # apt update - Install required packages:
root@testserver ~ # apt install apt-transport-https ca-certificates wget dirmngr gnupg software-properties-common -y - Add the repository:
root@testserver ~ # echo "deb http://ppa.launchpad.net/linuxuprising/java/ubuntu focal main" | tee /etc/apt/sources.list.d/linuxuprising-java.list - Download and add the public key for the repository:
root@testserver ~ # apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 73C3DB2A - Update the server:
root@testserver ~ # apt update - Install Java 16:
root@testserver ~ # apt install oracle-java16-installer --install-recommends
We can check the Java version with the following command:
root@testserver ~ # java -version
java version "16" 2021-03-16
Java(TM) SE Runtime Environment (build 16+36-2231)
Java HotSpot(TM) 64-Bit Server VM (build 16+36-2231, mixed mode, sharing)
Frequently asked questions
How do I check which Java version is installed?
Run java -version to display the installed Java version, runtime environment, and VM details.
Which repository provides Java 16 for Debian 10?
The linuxuprising PPA at ppa.launchpad.net/linuxuprising/java, added via /etc/apt/sources.list.d/linuxuprising-java.list.
Which package installs Java 16 itself?
The oracle-java16-installer package, installed with apt install oracle-java16-installer --install-recommends.