linux之centos安装java1.8
转自:----------------------------------------
# 检查当前机器是否有自带的JDK rpm -qa |grep java rpm -qa |grep jdk rpm -qa |grep gcj # 如果没有 则跳至安装步骤,有的话 进行卸载 rpm -qa | grep java | xargs rpm -e --nodeps # 更新yum源 yum update -y # 搜索yum中的软件包 yum list java-1.8* # 安装OpenJDK yum install java-1.8.0-openjdk* -y # 验证是否安装成功 java -version
-----------------------------------------------------------------------------------------------------------------------------------------