Ubuntu – Installing oracle java jdk 1.8.0_45 manually

14.04oracle

i have downloaded oracle javaSE from oracle website.

File Name :jdk-8u45-linux-x64.tar

had used command :

tar -zxf jdk-8u5-linux-x64.tar.gz -C /usr/lib/jvm

for extraction.

after this what procedure i should follow to install it.

Best Answer

mkdir if not present "/usr/lib/jvm" download package and type this comand from the download directory

tar -zxf jdk-8u5-linux-x64.tar.gz -C /usr/lib/jvm/jdk1.8.0_45

install java

sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.8.0_45/bin/java 100

to check if java is installed type

java -version

if you have multiple java you need to configure it by

sudo update-alternatives --config java

enter the number you want the default java to be from the list

Related Question