Skip to content

Instantly share code, notes, and snippets.

@wagnermarques
Forked from voor/install-java-8.sh
Created January 27, 2017 14:41
Show Gist options
  • Save wagnermarques/c704d0fab8fdc0988f606169e273c79c to your computer and use it in GitHub Desktop.
Save wagnermarques/c704d0fab8fdc0988f606169e273c79c to your computer and use it in GitHub Desktop.
Install Oracle Java 8 RPM
## You need to sudo this script, as it will install RPMs and run alternatives.
## You must accept the Oracle Binary Code License Agreement for Java SE to download this software.
## Read more here: http://www.oracle.com/technetwork/java/javase/terms/license/index.html
curl -L -H "Cookie: gpw_e24=xxx; oraclelicense=accept-securebackup-cookie;" http://download.oracle.com/otn-pub/java/jdk/8u74-b02/jdk-8u74-linux-x64.rpm -o /tmp/jdk-8-linux-x64.rpm && \
yum install -y /tmp/jdk-8-linux-x64.rpm && \
rm -rf /tmp/jdk-8-linux-x64.rpm
## OpenJDK started using 18000XX as their priority, so kick it up to 2 million to surpass them.
## java ##
alternatives --install /usr/bin/java java /usr/java/latest/jre/bin/java 2000000
## javaws ##
alternatives --install /usr/bin/javaws javaws /usr/java/latest/jre/bin/javaws 2000000
## Java Browser (Mozilla) Plugin 32-bit ##
alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so libjavaplugin.so /usr/java/latest/jre/lib/i386/libnpjp2.so 2000000
## Java Browser (Mozilla) Plugin 64-bit ##
alternatives --install /usr/lib64/mozilla/plugins/libjavaplugin.so libjavaplugin.so.x86_64 /usr/java/latest/jre/lib/amd64/libnpjp2.so 2000000
## Install javac only if you installed JDK (Java Development Kit) package ##
alternatives --install /usr/bin/javac javac /usr/java/latest/bin/javac 2000000
alternatives --install /usr/bin/jar jar /usr/java/latest/bin/jar 2000000
## Install the Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files
curl http://download.oracle.com/otn-pub/java/jce/8/jce_policy-8.zip -L -H "Cookie: gpw_e24=xxx; oraclelicense=accept-securebackup-cookie;" -o /tmp/jce_policy-8.zip && \
unzip -j -o /tmp/jce_policy-8.zip -d /usr/java/latest/jre/lib/security/ && \
rm -rf /tmp/jce_policy-8.zip
http://download.oracle.com/otn-pub/java/jdk/8u74-b02/jdk-8u74-linux-x64.rpm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment