Skip to content

Instantly share code, notes, and snippets.

@sthum
Last active June 15, 2016 11:35
Show Gist options
  • Save sthum/ab15c3ee5a8956d9d12307ca60e94819 to your computer and use it in GitHub Desktop.
Save sthum/ab15c3ee5a8956d9d12307ca60e94819 to your computer and use it in GitHub Desktop.
Oracle Java 8 Installation which sets the licence agreement in advance. This way this procedure can be included in any automated installation. I did use this in a packer build.
sudo apt-get update
# make add-apt-repository available
sudo apt-get install -y software-properties-common python-software-properties
## add java 8 repo
sudo add-apt-repository -y ppa:webupd8team/java
sudo apt-get update
# setting to automatically accept the licence to prevent the prompt
sudo echo debconf shared/accepted-oracle-license-v1-1 select true | \
sudo debconf-set-selections
sudo echo debconf shared/accepted-oracle-license-v1-1 seen true | \
sudo debconf-set-selections
# install java 8 and set defaults
sudo apt-get install -y oracle-java8-installer
sudo apt-get install -y oracle-java8-set-default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment