To determine if Java is already installed, enter the following command:
java -version
If the message java: command not found
displays, you must install the Java SDK as discussed in the next section.
See one of the following sections:
See this article on digitalocean.
Be sure to install the JDK and not the JRE.
yum -y install java-1.8.0-openjdk
{:.bs-callout .bs-callout-info} Java version 8 might not be available for all operating systems. For example, you can search the list of available packages for Ubuntu.
To install JDK 1.8 on Ubuntu, enter the following commands as a user with root
privileges:
add-apt-repository -y ppa:webupd8team/java
apt-get -y update
apt-get install -y oracle-java8-installer
For other options, see Oracle documentation.