Install Java 8
Elasticsearch require Java, so we will install that now. We will install a recent version of Oracle Java 8 because that is what Elasticsearch recommends. It should, however, work fine with OpenJDK, if you decide to go that route.
Add the Oracle Java PPA to
* sudo add-apt-repository -y ppa:webupd8team/java
apt package database: