赞
踩
目录
安装java(快速,但不完整):yum -y install java-1.8.0-openjdk.x86_64
卸载openjdk:
- rpm -qa|grep java
-
- rpm -e --nodeps java-1.8.0-openjdk-1.8.0.292.b10-1.el7_9.x86_64
-
- rpm -e --nodeps java-1.8.0-openjdk-headless-1.8.0.292.b10-1.el7_9.x86_64
- cd /usr/local
-
- sudo su root
-
- wget https://bucket-qinfeng2.oss-cn-beijing.aliyuncs.com/storehouse/v1/cloudfiles/tmp1/jdk-8u221-linux-x64.tar.gz
2.解压缩
tar -zxvf jdk-8u221-linux-x64.tar.gz
3.修改环境变量
vim /etc/profile
- export JAVA_HOME=/usr/local/jdk1.8.0_221
-
- export JRE_HOME=${JAVA_HOME}/jre
-
- export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib:$CLASSPATH
-
- export JAVA_PATH=${JAVA_HOME}/bin:${JRE_HOME}/bin
-
- export PATH=$PATH:${JAVA_PATH}
source /etc/profile
如果是服务器上openjdk改成jdk,部分基于java启动的应用需重启,如supervisor里面部署了java服务,也需重启
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。