Skip to content

Instantly share code, notes, and snippets.

@patmandenver
Last active August 29, 2015 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save patmandenver/0efd0b168901b6675b45 to your computer and use it in GitHub Desktop.
Save patmandenver/0efd0b168901b6675b45 to your computer and use it in GitHub Desktop.
Install Oracle 7 on Ubuntu 14.04
#!/bin/bash
#
# Simple script to install Oracle Java 7 with auto accepting the license
# No need to interact with it
#
######################################
if [[ $EUID -ne 0 ]]; then
echo "This script must be run with admin privileges 'sudo'"
echo "exiting...."
exit 1
fi
echo ""
echo "Installing Oracle Java 7"
echo "oracle-java7-installer shared/accepted-oracle-license-v1-1 select true" | sudo /usr/bin/debconf-set-selections
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | sudo tee /etc/apt/sources.list.d/webupd8team-java.list
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | sudo tee -a /etc/apt/sources.list.d/webupd8team-java.list
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886
apt-get update
apt-get -y install oracle-java7-installer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment