Linux中安装JDK1.8
一、下载
https://www.oracle.com/java/technologies/downloads/
二、上传解压到 /usr/local/java
tar -zxvf jdk-8u341-linux-x64.tar.gz -C /usr/local/java
三、修改环境变量
vim /etc/profile
export JAVA_HOME=/usr/local/java/jdk1.8.0_341
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH
source /etc/profile
四、验证
java -version