1#Update repo
2sudo apt update
3
4# Install java 8 from ubuntu repo
5sudo apt install openjdk-8-jdk -y
6
7#Set JAVA_HOME Path
8ls /usr/lib/jvm/java-8-openjdk-amd64/
9 export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
10 echo $JAVA_HOME
11
12 #Add JAVA bin directory to the PATH variable
13 export PATH=$PATH:$JAVA_HOME/bin
14 echo $PATH
15 java -version