This article is outdated and may not work correctly for current operating systems or software.
This guide assumes you have a brand-new Ubuntu 14.04 VPS from Vultr, using root. If you aren't logged in as root, type
then enter your root password. You will be logged into the root account.
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.
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:
... 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.