Created
August 20, 2015 20:26
-
-
Save kszarek/7f40772b21832a526038 to your computer and use it in GitHub Desktop.
Install Java on Ubuntu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -xe | |
echo "Add repository and install java" | |
apt-get -y install python-software-properties | |
add-apt-repository -y ppa:webupd8team/java | |
apt-get -q -y update | |
apt-get -y upgrade | |
echo "Accept license" | |
echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections | |
apt-get -y install oracle-java8-installer | |
echo "Update default java" | |
update-java-alternatives -s java-8-oracle | |
echo "Set environment variables" | |
apt-get -y install oracle-java8-set-default | |
echo "Check installation" | |
java -version | |
javac -version |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment