Edited at

CentOS7にOracleJDK8を入れる方法

More than 3 years have passed since last update.

元から入ってるjdkを削除

yum list installed | grep jdk

sudo yum remove java-1.7.0-openjdk.x86_64

sudo yum remove java-1.7.0-openjdk-headless.x86_64

JDK8を入れる

curl -L -o -H 'Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com; oraclelicense=accept-securebackup-cookie' 'http://download.oracle.com/otn-pub/java/jdk/8u31-b12/jdk-8u31-linux-x64.rpm'

sudo rpm -ivh jdk-8u31-linux-x64.rpm