# 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/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz"
tar -xzvf jdk-8u131-linux-x64.tar.gz
rm -rf jdk-8u131-linux-x64.tar.gz
# Configure JAVA_HOME
sudo vim ~/.bashrc
alias cls='clear'
export JAVA_HOME=~/jdk1.8.0_131
export JRE_HOME=~/jdk1.8.0_131/jre
export PATH=$PATH:~/jdk1.8.0_131/bin:/~/jdk1.8.0_131/jre/bin
source ~/.bashrc
java -version