CentOS安装Java环境
下载jdk x64 Compressed Archive
把文件放/usr/local
cd /usr/local
解压
tar -zxvf jdk-8u351-linux-x64.tar.gz
编辑
vim /etc/profile
尾部添加
# JDK1.8
export JAVA_HOME=/usr/local/jdk1.8.0_351
export NODE_HOME=/usr/local/node
export PATH=$JAVA_HOME/bin:$NODE_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
使生效
source /etc/profile