Oracle Java Archives - wiki

Ubuntu Install Oracle Java 8

Add repository

sudo add-apt-repository ppa:webupd8team/java


sudo apt-get update

Install Java

 sudo apt-get install oracle-java8-installer

Setting Java environment variables

sudo apt-get install oracle-java8-set-default

chk java version

 java -version

Get installation path

which java

Switching between Oracle Java 8 and Java 7

 sudo update-java-alternatives -s java-7-oracle

Setting Up JAVA_HOME

Edit /etc/profile (sudo nano /etc/profile ) and add the following

export JAVA_HOME=/usr/lib/jvm/java-8-oracle

save the file and execute

source /etc/profile
By bm on October 2, 2016 | ubuntu | A comment?
Tags: , ,