下方链接下载JDK
JDK下载 - 编程宝库 (codebaoku.com)
解压到指定目录
--javascripttypescriptbashsqljsonhtmlcssccppjavarubypythongorustmarkdown
mkdir -p /usr/lib/jdktar -zxvf jdk-8u341-linux-x64.tar.gz -C /usr/lib/jdkvim /etc/profile添加到文件
JAVA_HOME=/usr/lib/jdk/jdk1.8.0_341
CLASSPATH=
PATH:$JAVA_HOME/bin
export PATH JAVA_HOME CLASSPATH
执行profile 文件
source /etc/profile
java -version
卸载
检测jdk安装包
--javascripttypescriptbashsqljsonhtmlcssccppjavarubypythongorustmarkdown
rpm -qa | grep java显示java-1.7.0-openjdk-1.7.0.111-2.6.7.8.el7.x86_64python-javapackages-3.4.1-11.el7.noarchtzdata-java-2016g-2.el7.noarchjavapackages-tools-3.4.1-11.el7.noarchjava-1.8.0-openjdk-1.8.0.102-4.b14.el7.x86_64java-1.8.0-openjdk-headless-1.8.0.102-4.b14.el7.x86_64java-1.7.0-openjdk-headless-1.7.0.111-2.6.7.8.el7.x86_64
卸载openjdk
--javascripttypescriptbashsqljsonhtmlcssccppjavarubypythongorustmarkdown
[root@localhost software]# rpm -e --nodeps tzdata-java-2016g-2.el7.noarch[root@localhost software]# rpm -e --nodeps java-1.7.0-openjdk-1.7.0.111-2.6.7.8.el7.x86_64[root@localhost software]# rpm -e --nodeps java-1.7.0-openjdk-headless-1.7.0.111-2.6.7.8.el7.x86_64[root@localhost software]# rpm -e --nodeps java-1.8.0-openjdk-1.8.0.102-4.b14.el7.x86_64[root@localhost software]# rpm -e --nodeps java-1.8.0-openjdk-headless-1.8.0.102-4.b14.el7.x86_64或者# yum remove *openjdk*之后再次输入rpm -qa | grep java 查看卸载情况:[root@localhost software]# rpm -qa | grep javapython-javapackages-3.4.1-11.el7.noarchjavapackages-tools-3.4.1-11.el7.noarch