This guide assumes you have a brand-new Ubuntu 14.04 VPS from AKLWEB Host, using root. If you aren’t logged in as root, type
su -
then enter your root password. You will be logged into the root account.
Java 8 is a 2014 update to Java that includes security updates, performance updates, and new programming enhancements. Some of the new enhancements include lambda expressions, date and time API, and the Nashhorn JavaScript engine.
At the time of writing, Java 8 is not in the sources list by default, so we have to add the “Webupd8” repo, which contains Java 8.
add-apt-repository ppa:webupd8team/java
apt-get update
Run the following command to install Java 8:
apt-get install oracle-java8-installer
During the installation, you will need to agree to the Oracle license. This is as simple as selecting “yes” and hitting “enter”.
Execute this command to check that the installation was successful:
java -version
… and you will output similar to the following (depending on the current version of Java 8).
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)
And you’re good to go! Java 8 is now installed on your Ubuntu VPS.