how to install java 8 in ubuntu code example
Example 1: java 8 install ubuntu
sudo apt-get install openjdk-8-jdk
Example 2: install java ubuntu
sudo apt install default-jdk
Example 3: how to install java 8 and set java_home in ubuntu
sudo apt update
sudo apt install openjdk-8-jdk -y
ls /usr/lib/jvm/java-8-openjdk-amd64/
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
echo $JAVA_HOME
export PATH=$PATH:$JAVA_HOME/bin
echo $PATH
java -version
Example 4: how to install java 8 in ubuntu 16.04
sudo apt-get install openjdk-8-jdk