install java on linux code example

Example 1: installing java on linux

# install default JDK
sudo apt install default-jdk
# install default JRE
sudo apt install default-jre
# install specific JDK version
sudo apt install openjdk-17-jdk
# install specific JRE version
sudo apt install openjdk-17-jre

Example 2: install jdk linux

sudo apt install openjdk-8-jdk

Example 3: install java ubuntu

sudo apt install default-jdk

Example 4: ubuntu install jre

sudo apt install openjdk-8-jre

Example 5: how to install java on ubuntu 18.0.4

$ sudo apt install openjdk-11-jdk

Tags:

Java Example