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: http://www.webupd8.org/2012/06/how-to-install-oracle-java-7-in-debian.html

cat > /etc/apt/sources.list.d/webupd8team-java.list << EOF
# http://www.webupd8.org/2012/06/how-to-install-oracle-java-7-in-debian.html
deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main
deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main
EOF

apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --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