How to install Oracle Java

As provided by SiKing (but posted here instead of being included as a script).

This could be handy for Tomcat or Tomcat-Apache appliances; or any appliance that you need to use Oracle Java on (rather than OpenJDK - which is avaialble from the repos).

Read more about installing Oracle Java:

cat > /etc/apt/sources.list.d/webupd8team-java.list << EOF
deb trusty main
deb-src trusty main

apt-key adv --keyserver hkp:// --recv-keys EEA14886

apt-get update

# accept Oracle license
echo "oracle-java7-installer shared/accepted-oracle-license-v1-1 select true" \
    | debconf-set-selections

# perform the install
apt-get install oracle-java7-installer oracle-java7-set-default