Tag: installation

Oracle’s Java 8 is a programming language that creates many of the applications and websites in use today. Its ubiquitous and stable nature makes it a favorite amongst Google and Android developers for the last 20 years. If you have a Liquid Web Core Managed Ubuntu 16.04 LTS server, contact our support team for help with installation. Otherwise, this tutorial guides you through how to install Java 8 (Java Development Kit) and set the path of the JAVA_HOME variable.

Pre-Flight Check

Open the terminal and log in as root. If you are logged in as another user, you will need to add sudo before each command.

Working on a Linux Ubuntu 16.04 server

No installations of previous Java versions

Install Oracle Java 8

Step 1: Update & Upgrade

It is advised to update your system by copy and pasting the command below. Be sure to accept the update by typing Y when asked to continue:

apt-get update && apt-get upgrade

Step 2: Install the Repository

WebUpd8 Team Personal Package Archive (PPA), a third party repository, allows us to download the package necessary for Java 8 installation. Press Enter to continue the installation.

add-apt-repository ppa:webupd8team/java

Once again, update your package list.

apt-get update

Step 3: Install Java 8

Use the apt-get command to install Oracle’s Java 8 via their installer:

apt-get install oracle-java8-installer

Click Y to continue and press Enter to agree to the licensing agreement.

Copy the highlighted path from the second row: /usr/lib/jvm/java-8-oracle/jre/bin/java/. After copying, open the file /etc/environment and add in the path of your Java installation to the end of your file.

vim /etc/environment

JAVA_HOME="/usr/lib/jvm/java-8-oracle/jre/bin/java"

Save the file by hitting ESC button and type :wq to execute the command below to recognize the changes to the file:

source /etc/environment

You should now see the path of installation when using the $Java_Home variable:

echo $JAVA_HOME

Output:

~# echo $JAVA_HOME/usr/lib/jvm/java-8-oracle/jre/bin/java

Sidebar

Have some Questions?

Our Heroic Sales and Support teams are available 24 hours by phone or e-mail to assist.