CentOS7卸载OpenJDK安装Oracle JDK

CentOS7卸载OpenJDK安装Oracle JDK

1.查看JDK安装版本

[root@localhost ~]#java -version
java version *1.7.0_51*
OpenJDK Runtime Environment ( rhel-2.4.5.5.el7-x86_64 u51-b31)
OpenJDK 64-Bit Server VM (build 24.51-b03, mixed mode)
2.查找OpenJDK安装包
rpm -qa | grep openjdk
java-1.7.0-openjdk-headless-1.7.0.51-2.4.5.5.el7.x86_64
java-1.7.0-openjdk-1.7.0.51-2.4.5.5.el7.x86_64

3.卸载OpenJDK安装包


[root@localhost ~]#yum -y remove java-1.7.0-openjdk-headless.x86_64
[root@localhost ~]#yum -y remove java-1.7.0-openjdk.x86_64
4.下载JDK1.7安装包(jdk-7u65-linux-x64.rpm
5.安装JDK1.7
[root@localhost 下载]#yum install jdk-7u65-linux-x64.rpm
6.配置环境变量
[root@localhost ~]#vim /etc/profile
在文件末尾添加如下内容
JAVA_HOME=/usr/java/jdk1.7.0_65
PATH=$JAVA_HOME/bin:$PATH
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME
export PATH
export CLASSPATH
[root@localhost ~]#source /etc/profile
7.查看安装结果
[root@localhost ~]#java -version
java version "1.7.0_65"
Java(TM) SE Runtime Environment (build 1.7.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 24.65-b04.mixed mode)
至此已经完成了JDK1.7的安装

阅读更多
文章标签: openjdk jdk centos
个人分类: CentOS
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭