How to install Oracle JDK 8 on ubuntu 15.10

To install Oracle JDK 8 on ubuntu 15.10

1.Go to Oracle JDK8 download page. And download the latest linux jdk in .tar.gz format.
Here its (64 bit) jdk-8u66-linux-x64.tar.gz

Selection_020
2.Copy your JDK .tar.gz file to your Desktop.

3.Open Terminal.To open terminal click the Dash home from unity launcher.And type terminal in the search field.And click Terminal.

terminal

4.Type the below code in terminal and hit enter to extract in Home folder.

tar -xvf ~/Desktop/jdk-8u66-linux-x64.tar.gz

5.Next Type below command in terminal to create a new folder.

sudo mkdir -p /usr/lib/jvm/jdk1.8.0

Type your ubuntu password if needed and press enter.

6.Now type below command to move files to jdk1.8.0 folder.

sudo mv jdk1.8.0_66/* /usr/lib/jvm/jdk1.8.0/

Note:change this (jdk1.8.0_66) according to your jdk version.
Example: for JDK 8 update 67 use jdk1.7.0_67

Also Read:  Verify and Check JAVA Installation on Ubuntu

7.Type below command in terminal and hit enter.

sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.8.0/bin/java" 1

8.Then type below command in terminal and hit enter.

sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.8.0/bin/javac" 1

9.Then type below command in terminal and hit enter.

sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.8.0/bin/javaws" 1

10.After the successful installation,to check the installed version type

java -version

java version

If you liked this article, please subscribe to our YouTube Channel. You can also stay connected with us on X (Twitter) and Facebook.



This Post Has 3 Comments

  1. jens patel

    perfect method… thanks..

Leave a Reply