installing oracle jdk 8 on ubuntu and fedora

tar zxvf jdk-8u172-linux-x64.tar.gz sudo mkdir /usr/java sudo mv jdk1.8.0_172/ /usr/java sudo update-alternatives –install “/usr/bin/java” “java” “/usr/java/jdk1.8.0_172/bin/java” 1 sudo update-alternatives –install “/usr/bin/javac” “javac” “/usr/java/jdk1.8.0_172/bin/javac” 1 sudo update-alternatives –install “/usr/bin/javaws” “javaws” “/usr/java/jdk1.8.0_172/bin/javaws” 1 sudo update-alternatives –install /usr/bin/jar “jar” “/usr/java/jdk1.8.0_172/bin/jar” 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 chmod a+x /usr/bin/jar sudo chown -R root:root /usr/java/jdk1.8.0_172