Skip to content

Instantly share code, notes, and snippets.

@diegopacheco
Last active May 21, 2018 23:52
Show Gist options
  • Save diegopacheco/3b5b64279eeb9aaf0038 to your computer and use it in GitHub Desktop.
Save diegopacheco/3b5b64279eeb9aaf0038 to your computer and use it in GitHub Desktop.
How to Install ORACLE JDK 8 on Amazon Linux OS / CentOS?

Download and install Java JDK 8

# Remove java 7
sudo yum remove -y java

# Install basic packages
sudo yum install -y git

# Download and install java 8
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/8u171-b11/512cd62ec5174c3487ac17c61aaa89e8/jdk-8u171-linux-x64.tar.gz"
tar -xzvf jdk-8u171-linux-x64.tar.gz
rm -rf jdk-8u171-linux-x64.tar.gz

# Configure JAVA_HOME
sudo vim ~/.bashrc

ENV Vars $ sudo vim ~/.bashrc

alias cls='clear'

export JAVA_HOME=~/jdk1.8.0_171
export JRE_HOME=$JAVA_HOME/jre
export PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment