Updating to Java-8 on Ubuntu 12.04.

Updating to Java 8 to  is a time consuming task, and after spending half a day at it, I decided to blog about it. The steps are easy to follow, but mind you very time consuming.

STEP 1:

sudo add-apt-repository ppa:webupd8team/java

sudo apt-get update

sudo apt-get install oracle-java8-installer

For successful completion of the last step you are at the mercy of the internet speed. May the force be with you!

STEP 2:

If you have reached this step without any error, then congrats the hurdle is crossed. Lets check if the system has updated or not.

java -version

Expected Output:

java version “1.8.0_25”
Java(TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)

STEP 3: (IF YOU DON’T GET THE EXPECTED OUTPUT)

We need to manually set the priority of the latest  version.

sudo update-alternatives --config java

Here, you will be prompted to enter the number corresponding to the version you wish to default. The one with * is being used currently. Now type the number corresponding to java-8-oracle(auto mode/manual mode…don’t know the difference, I selected auto mode, sounds safer)

goto: STEP 2

STEP 4:

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

STEP 5:(optional)

sudo apt-get update

sudo apt-get autoclean

And that brings us to the end of this task.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s