参考:https://blog.csdn.net/weixin_44829804/article/details/125389100
https://blog.csdn.net/dgfdhgghd/article/details/123207017
https://www.cnblogs.com/aerfazhe/p/15545946.html
一、下载安装包
下载jdk1.8 for linux的安装包 jdk-8u11-linux-x64.tar.gz
链接:https://pan.baidu.com/s/1tfWnkVZ1G9v8GPyz2ooGUw
提取码:1234
二、上传并配置环境
1、上传安装包到java目录/usr(目录可自己任意创建)下,解压文件,命令如下:
cd /usr
tar -zxvf jdk-8u11-linux-x64.tar.gz
vim ~/.profile
添加以下内容
export JAVA_HOME=/usr/jdk1.8.0_11
export CLASSPATH=$JAVA_HOME/lib/
export PATH=$PATH:$JAVA_HOME/bin
export PATH JAVA_HOME CLASSPATH
source ~/.profile
[root@liujunpcV7-03 ~]# java -version
java version "1.8.0_11"
Java(TM) SE Runtime Environment (build 1.8.0_11-b12)a
Java HotSpot(TM) 64-Bit Server VM (build 25.11-b03, mixed mode)
验证完毕。
标签:JDK1.8,JAVA,tar,CentOS7,usr,https,linux,HOME,安装 From: https://www.cnblogs.com/qsds/p/16641323.html