openjdk1.8部署
JDK安装
2021-03-03 小游戏cat采用的openjdk版本
openjdk 1.8.262.10版本
需要以下版本
个人建议用迅雷下载,不需要用wget方式.
下面是jdk rpm包不可或缺的,四个不能少.
yum 顺序按照下面方式即可.
java-1.8.0-openjdk-headless-1.8.0.262.b10-1.el7.x86_64
tzdata-java-2020a-1.el7.noarch
java-1.8.0-openjdk-devel-1.8.0.262.b10-1.el7.x86_64
java-1.8.0-openjdk-1.8.0.262.b10-1.el7.x86_64
tzdata依赖包
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/tzdata-java-2020a-1.el7.noarch.rpm
headless依赖包
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/java-1.8.0-openjdk-headless-1.8.0.262.b10-1.el7.x86_64.rpm
openjdk依赖包
wget http://mirror.centos.org/centos/7/updates/x86_64/Packages/java-1.8.0-openjdk-1.8.0.282.b08-1.el7_9.x86_64.rpm
openjdk-devel依赖包
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/java-1.8.0-openjdk-devel-1.8.0.262.b10-1.el7.x86_64.rpm
安装
yum -y localinstall java-1.8.0-openjdk-1.8.0.262.b10-1.el7.x86_64.rpm java-1.8.0-openjdk-devel-1.8.0.262.b10-1.el7.x86_64.rpm java-1.8.0-openjdk-headless-1.8.0.262.b10-1.el7.x86_64.rpm tzdata-java-2020a-1.el7.noarch.rpm
添加环境变量
vim /etc/profile
#JDK1.8.0_262
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.262.b10-1.el7.x86_64/
export PATH=/jre/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
#apr
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/apr/lib
export LD_RUN_PATH=$LD_RUN_PATH:/usr/local/apr/lib
生效
source /etc/profile