RHEL 安装配置JAVA 8

一. 下载并解压

htps://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html  ## 下载相关版本


mkdir /usr/local/java
tar -zxf jdk-8u271-linux-x64.tar.gz -C /usr/local/java

二. 配置环境变量

vi /etc/profile

export JAVA_HOME=/usr/local/java/jdk1.8.0_271
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH

三. 生效

source /etc/profile

四. 验证

[root@dragon01 ~]# java -version
java version "1.8.0_271"
Java(TM) SE Runtime Environment (build 1.8.0_271-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.271-b09, mixed mode)

 

posted @ 2020-11-26 14:45  风雨飘泊  阅读(192)  评论(0编辑  收藏  举报