Thursday, 28 May 2015

Install Oracle Java in Ubuntu/Linux

Installing Oracle JDK in Ubuntu with apt-get install method

First we need to add properties because Ubuntu will not by Default.

Open Terminal Ctrl+Alt+T or From Application

Enter these commends one by one

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update

Oracle JDK 7

Use below line in Terminal

sudo apt-get install oracle-java7-installer

Oracle JDK 8

sudo apt-get install oracle-java8-installer

After installation please check the java version using below syntax

java -version

if your oracle not set please set using below syntax

sudo update-alternatives --config java

Select the oracle java and Enter it will set default. Thank you!!! any Doubt please add comments!!!

Source : DigitalOcean