How to install Oracle JDK 8 on Ubuntu

Connect with

java8_logo
This post will help you to install Oracle JAVA 8 on Ubuntu 16, 15, 14 & 12 LTS or Linux Mint systems using PPA. Although there are are multiple way of installation of JDK one of them is as following.

Step 1. Add Java 8 PPA

First of all you need to add webupd8team Java PPA repository in your system and install Oracle Java 8 using following set of commands.


$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt-get install oracle-java8-installer

Step 1. Add Java 8 PPA (Optional)

following step is optional , if your system is not upated with ppa file you can follow above steps as well instead of directly run installer.
You need to add webupd8team Java PPA repository in your system. Edit a new ppa file /etc/apt/sources.list.d/java-8-debian.list in text editor

$ sudo vim /etc/apt/sources.list.d/java-8-debian.list

and add following content in it.

deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main
deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main

Step 2. import GPG key

Now import GPG key on your system for validate packages before installing them.

$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886

Step 3. Verify Installed Java Version

After successfully installing oracle Java using above step verify installed version using
following command.

ranjetjha@jha:~$ java -version
ranjeetjha@jha:~$ java -version
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)

Step 4. Configuring Java Environment

In Webupd8 ppa repository also providing a package to set environment variables, Install this package using following command.


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

Reference

for more detail


Connect with

Leave a Reply

Your email address will not be published. Required fields are marked *