install java runtime 8 linux ubuntu code example
Example 1: debian install java
sudo apt install -y default-jre
sudo apt update
sudo apt install -y apt-transport-https ca-certificates wget dirmngr gnupg software-properties-common
wget -qO - https://adoptopenjdk.jfrog.io/adoptopenjdk/api/gpg/key/public | sudo apt-key add -
sudo add-apt-repository --yes https://adoptopenjdk.jfrog.io/adoptopenjdk/deb/
sudo apt update
sudo apt install -y adoptopenjdk-8-hotspot
sudo update-alternatives --config java
Example 2: install java ubuntu
sudo apt install default-jre