How to accept the Oracle JDK8 license automatically
you can use the following command:
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | tee /etc/apt/sources.list.d/webupd8team-java.list echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main" | 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 install oracle-java8-installer
#There is a package in our repository that automatically sets the Java 8 environment variab#les and sets JDK8 as the default JDK
sudo apt-get install oracle-java8-set-default
#to check
java -version
#java version "1.8.0_60" #Java(TM) SE Runtime Environment (build 1.8.0_60-b27) #Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
javac -version
#javac 1.8.0_60
echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | sudo /usr/bin/debconf-set-selections
No comments:
Post a Comment