环境准备
[root@localhost bin]
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 "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)