Install Oracle JDK 1.8

By | 28th December 2015

Overview

The easiest way to install JDK 1.8 is to use the PPA (Personal Package Archive) provided by webupd8.org – see resources 1.

Procedure

To install package using PPA, “add-apt-repository” is required. If add-apt-repository is not already installed, install “software-properties-common” package first – which included add-apt-repository

>apt-get install python-software-properties

Add the WebUpd8 Oracle Java PPA repository

echo deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main | tee /etc/apt/sources.list.d/webupd8team-java.list
echo deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main | tee -a /etc/apt/sources.list.d/webupd8team-java.list

Download the public key of the server where the package resides

apt-key adv –keyserver hkp://keyserver.ubuntu.com:80 –recv-keys EEA14886

Synchronize the package index files and install

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

When prompted, click OK to accept the licence agreement.
Check installation upon completion

> javac -version
javac 1.8.0_66
> java -version
java version "1.8.0_66"
Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
Java HotSpot(TM) Server VM (build 25.66-b17, mixed mode)
> dpkg --list | grep java
ii  java-common                          0.52                         all          Base of all Java packages
ii  oracle-java8-installer               8u66+8u65arm-1~webupd8~1     all          Oracle Java(TM) Development Kit (JDK) 8
ii  oracle-java8-set-default             8u66+8u65arm-1~webupd8~1     all          Set Oracle JDK 8 as default Java

Resources

  1. How To Install Oracle Java 8 In Debian Via Repository [JDK8]
  2. How To Install Java on Ubuntu with Apt-Get – additional notes

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.