1、下载jdk压缩包
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
2、解压
tar -zxvf jdk-8u191-linux-x64.tar.gz /opt/jdk
3、设置环境变量
vim ~/.bashrc
内容:
1 | export JAVA_HOME=/opt/jdk |
4、立即生效环境变量
source ~/.bashrc
1、下载jdk压缩包
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
2、解压
tar -zxvf jdk-8u191-linux-x64.tar.gz /opt/jdk
3、设置环境变量
vim ~/.bashrc
内容:
1 | export JAVA_HOME=/opt/jdk |
4、立即生效环境变量
source ~/.bashrc