Skip to content

How to Install Java 16 on Linux

Christopher Sakel  ·   ·  Updated on  ·  1 min Reading time

Tutorials & Guides · min 1 Reading time · Christopher Sakel

How to Install Java 16 on Linux

In this blog article I'll show you how to install Java 16 on Debian 10.
Now let's run the following command:

  1. Update the server:
    root@testserver ~ # apt update
  2. Install required packages:
    root@testserver ~ # apt install apt-transport-https ca-certificates wget dirmngr gnupg software-properties-common -y
  3. 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
  4. Download and add the public key for the repository:
    root@testserver ~ # apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 73C3DB2A
  5. Update the server:
    root@testserver ~ # apt update
  6. 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.