centos7下安装Oracle jdk8(免安装版)

java:(账号:347004884@qq.com  密码:Oracle123)
jdk1.8 (解压配置安装):
创建并进入目录/usr/java
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
下载jdk-8u221版本,上传至服务至器目录/usr/java下
tar -zxvf jdk-8u221-linux-x64.tar.gz --> /usr/java/jdk1.8.0_221
添加环境变量(vim /etc/profile 在最后按o键输入,粘贴下面配置项)
export JAVA_HOME=/usr/java/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


java -version
java version "1.8.0_221"
Java(TM) SE Runtime Environment (build 1.8.0_221-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.221-b11, mixed mode)

posted @ 2019-09-07 10:25  yi点黑暗  阅读(1346)  评论(0编辑  收藏  举报