linux 源码安装jdk及环境变量配置
1.下载jdk
oracle官网下载jdk
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
上传软件到/usr/local/software 文件夹下, 并进入该文件夹
mkdir /usr/local/software
cd /usr/local/software
2.解压压缩包
tar -zxvf jdk-8u191-linux-x64.tar.gz -C /usr/local/
cd /usr/local/
修改文件名 jdk
mv jdk1.8.0_191/ jdk
3.配置环境变量
vim /etc/profile
在尾部输入
export JAVA_HOME=/usr/local/jdk
export PATH=$JAVA_HOME/bin:$PATH
输入:wq 退出
source /etc/profile