步骤一用java -version查看系统是否有自带的jdk
步骤二卸载掉系统自带的jdk版本 rpm -qa |grep java rpm -qa |grep jdk rpm -qa |grep gcj rpm -qa | grep java | xargs rpm -e --nodeps yum -y remove java-1.8.0-openjdk-headless.x86_64
步骤三安装 yum -y remove java-1.8.0-openjdk-headless.x86_64 yum install java-1.8.0-openjdk* -y