yum安装openJDK1.7

环境准备

[root@localhost bin]# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 7.6 (Maipo)

查看JDK版本

[root@localhost bin] yum search java|grep jdk
ldapjdk-javadoc.noarch : Javadoc for ldapjdk
java-1.7.0-openjdk.aarch64 : OpenJDK Runtime Environment
java-1.7.0-openjdk-accessibility.aarch64 : OpenJDK accessibility connector
java-1.7.0-openjdk-demo.aarch64 : OpenJDK Demos
java-1.7.0-openjdk-devel.aarch64 : OpenJDK Development Environment
java-1.7.0-openjdk-headless.aarch64 : The OpenJDK runtime environment without
java-1.7.0-openjdk-javadoc.noarch : OpenJDK API Documentation
java-1.7.0-openjdk-src.aarch64 : OpenJDK Source Bundle
java-1.8.0-openjdk.aarch64 : OpenJDK Runtime Environment
java-1.8.0-openjdk-accessibility.aarch64 : OpenJDK accessibility connector
java-1.8.0-openjdk-accessibility-debug.aarch64 : OpenJDK accessibility connector
java-1.8.0-openjdk-debug.aarch64 : OpenJDK Runtime Environment with full debug
java-1.8.0-openjdk-demo.aarch64 : OpenJDK Demos
java-1.8.0-openjdk-demo-debug.aarch64 : OpenJDK Demos with full debug on
java-1.8.0-openjdk-devel.aarch64 : OpenJDK Development Environment
java-1.8.0-openjdk-devel-debug.aarch64 : OpenJDK Development Environment with
java-1.8.0-openjdk-headless.aarch64 : OpenJDK Runtime Environment
java-1.8.0-openjdk-headless-debug.aarch64 : OpenJDK Runtime Environment with
java-1.8.0-openjdk-javadoc.noarch : OpenJDK API Documentation
java-1.8.0-openjdk-javadoc-debug.noarch : OpenJDK API Documentation for packages
java-1.8.0-openjdk-javadoc-zip.noarch : OpenJDK API Documentation compressed in
java-1.8.0-openjdk-javadoc-zip-debug.noarch : OpenJDK API Documentation
java-1.8.0-openjdk-src.aarch64 : OpenJDK Source Bundle
java-1.8.0-openjdk-src-debug.aarch64 : OpenJDK Source Bundle for packages with
java-11-openjdk.aarch64 : OpenJDK Runtime Environment 11
java-11-openjdk-debug.aarch64 : OpenJDK Runtime Environment 11 with full debug
java-11-openjdk-demo.aarch64 : OpenJDK Demos 11
java-11-openjdk-demo-debug.aarch64 : OpenJDK Demos 11 with full debug on
java-11-openjdk-devel.aarch64 : OpenJDK Development Environment 11
java-11-openjdk-devel-debug.aarch64 : OpenJDK Development Environment 11 with
java-11-openjdk-headless.aarch64 : OpenJDK Headless Runtime Environment 11
java-11-openjdk-headless-debug.aarch64 : OpenJDK Runtime Environment with full
java-11-openjdk-javadoc.aarch64 : OpenJDK 11 API documentation
java-11-openjdk-javadoc-debug.aarch64 : OpenJDK 11 API documentation for
java-11-openjdk-javadoc-zip.aarch64 : OpenJDK 11 API documentation compressed in
java-11-openjdk-javadoc-zip-debug.aarch64 : OpenJDK 11 API documentation
java-11-openjdk-jmods.aarch64 : JMods for OpenJDK 11
java-11-openjdk-jmods-debug.aarch64 : JMods for OpenJDK 11 with full debug on
java-11-openjdk-src.aarch64 : OpenJDK Source Bundle 11
java-11-openjdk-src-debug.aarch64 : OpenJDK Source Bundle for packages with
ldapjdk.noarch : The Mozilla LDAP Java SDK

安装jdk

yum install java-1.7.0-openjdk* -y

配置环境变量

 vim /etc/profile
 #在末尾添加
JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.191-2.6.15.5.el7.aarch64 #此处依据实际路径
JRE_HOME=$JAVA_HOME/jre
CLASS_PATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
export JAVA_HOME JRE_HOME CLASS_PATH PATH

环境变量生效

source /etc/profile

验证

[root@localhost bin]# java -version
java version "1.7.0_191"
OpenJDK Runtime Environment (rhel-2.6.15.5.el7-aarch64 u191-b01)
OpenJDK 64-Bit Server VM (build 24.191-b01, mixed mode)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

早九晚十二

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值