installing oracle jdk 8 on ubuntu

tar zxvf jdk-8u151-linux-x64.tar.gz sudo mkdir /usr/java sudo mv jdk1.8.0_151/ /usr/java sudo update-alternatives –install “/usr/bin/java” “java” “/usr/java/jdk1.8.0_151/bin/java” 1 sudo update-alternatives –install “/usr/bin/javac” “javac” “/usr/java/jdk1.8.0_151/bin/javac” 1 sudo update-alternatives –install “/usr/bin/javaws” “javaws” “/usr/java/jdk1.8.0_151/bin/javaws” 1 fix the permissions sudo chmod a+x /usr/bin/java sudo chmod a+x /usr/bin/javac sudo chmod a+x /usr/bin/javaws sudo chown -R root:root /usr/java/jdk1.8.0_151 sudo nano /etc/environment and