Skip to content

Instantly share code, notes, and snippets.

@yarinkos
Created February 1, 2018 10:24
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 yarinkos/8280eb9941183884276c9872823659f8 to your computer and use it in GitHub Desktop.
Save yarinkos/8280eb9941183884276c9872823659f8 to your computer and use it in GitHub Desktop.
Java 8 installation Centos 7
#!/bin/bash
cd /opt/
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u161-b12/2f38c3b165be4555a1fa6e98c45e0808/jdk-8u161-linux-x64.tar.gz"
tar xzf jdk-8u161-linux-x64.tar.gz
echo 'export JAVA_HOME=/opt/jdk1.8.0_161
export JRE_HOME=/opt/jdk1.8.0_161/jre
export PATH=$PATH:/opt/jdk1.8.0_161/bin:/opt/jdk1.8.0_161/jre/bin' >> /etc/environment
source /etc/environment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment