apt install java 8 code example
Example 1: java 8 install ubuntu
sudo apt-get install openjdk-8-jdk
Example 2: apt install java 11
sudo apt-get update
sudo apt-get install oracle-java11-installer-local
sudo apt-get install openjdk-8-jdk
sudo apt-get update
sudo apt-get install oracle-java11-installer-local