centos7安装java教程
centos7安装java教程
版本:jdk1.8.0_301
1、下载jdk
https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html
2、安装jdk
tar -xzf jdk-8u301-linux-x64.tar.gz
mv jdk1.8.0_301 /usr/local/jdk1.8.0
3、配置java环境变量
vim /etc/profile
#java
export JAVA_HOME=/usr/local/jdk1.8.0
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH:$HOMR/bin
source /etc/profile #生效
4、测试