25th Anniversary Savings | 25% Off Dedicated Servers*Shop Now
25th Anniversary Savings | 25% Off VPS Hosting* †††Shop Now
Limited Inventory: High-Performance AMD-Powered Servers Now Available.* Shop Now >
Dedicated Hosting Deals | From $99/moShop Now
Earn hosting credits and a chance to win an Amazon gift card when you refer friends to Liquid Web!Read our promo rules

How to Install Oracle Java 8 on Ubuntu 14.04 LTS

Posted on by Echo Diaz | Updated:
Reading Time: 2 minutes
Pre-Flight Check
  • These instructions are intended specifically for installing Oracle Java 8 on Ubuntu 14.04 LTS.
  • I’ll be working from a Liquid Web Core Managed Ubuntu 14.04 LTS server with Apache and PHP installed, and I’ll be logged in as a non-root user. If you need more information then visit our tutorial on How to Add a User and Grant Root Privileges on Ubuntu 14.04 LTS.

Install Oracle Java 8

Step #1: Add the WebUpd8 Team Personal Package Archive (PPA)

Add the PPA:

sudo apt-add-repository ppa:webupd8team/java

Note: Personal Package Archives include unsupported packages and are untrusted by the primary Ubuntu branch. At the time of publication, the WebUpd8 Oracle Java PPA is an installer (meaning it does not include any Oracle Java binaries, but will download and install them). Use this PPA at your own risk.
Step #2: The Installation

As a matter of best practice we’ll update our packages:

sudo apt-add-repository ppa:webupd8team/java

Update apt-get once more:

sudo apt-get update

Kick off the installer to completely install Java from the PPA.

sudo apt-get install oracle-java8-installer

Be sure to accept the Oracle license!

Oracle Java License Agreement

Oracle Java License Screen

Step #3: Verify Installation

Now verify that Java is installed and is of version 1.8.x:

java -version

Your result should be similar to:

Java(TM) SE Runtime Environment (build 1.8.0_181-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.181-b13, mixed mode)

Optional JAVA_HOME Variable

Temporarily Set the JAVA_HOME variable

Use the export command for the JAVA_HOME variable to show up as an environmental variable, one that can be used by future child processes:

export JAVA_HOME=/usr/lib/jvm/java-8-oracle

Permanently Set the JAVA_HOME variable

vim ~/.bashrc

Insert the following into the bottom .bashrc file:

export JAVA_HOME

For changes to the .bashrc file to be recognize run the following command:

source ~/.bashrc

About the Author: Echo Diaz

Throughout Echo's four year stint as a technical support specialist, her passion for breaking down complex concepts had to lead to a career in professional writing. As a former top tier support specialist, she added a distinctive element to her written work that spoke to customer feedback and concerns. Echo occasionally pops her head out from behind her computer to watch her dog energetically run around the yard and unabashedly shovels money into buying tickets to see her favorite musical artists.

Latest Articles

How to Edit the PHP Memory for Your WordPress Site via WP Toolkit

Read Article

What is CGI-Bin and What Does it Do?

Read Article

Top 10 Password Security Standards

Read Article

Top 10 Password Security Standards

Read Article

How to Use the WP Toolkit to Secure and Update WordPress

Read Article