Discuss your project
Linux Ubuntu 14.04 LTS Ubuntu 16.04 LTS

Ubuntu: install Java 8 (JDK 8) on Ubuntu

Step 1: Install Java 8 (JDK 8) $ sudo add-apt-repository ppa:webupd8team/java $ sudo apt-get update $ sudo apt-get install oracle-java8-installer Step 2: Verify the Java version $ java -version java version "1.8.0_25" Java(TM) SE Runtime Environment (build...

Ubuntu: install Java 8 (JDK 8) on Ubuntu

Step 1: Install Java 8 (JDK 8)

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

Step 2: Verify the Java version

$ java -version

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: Generate the default variables

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

Version context

This procedure describes the software and the environment available at the time of its publication. The packages, interfaces, and repositories mentioned may have changed or disappeared; first check the system version and its support level.

cat /etc/os-release
uname -r

Work on a backup or a snapshot, note every modified file, and prepare for rollback. For a current workstation or server, prefer signed packages from officially supported repositories.

Reference: official Ubuntu lifecycle.

Share this article