1.下载压缩包
https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html
2.解压压缩包
tar -zxvf jdk-8u221-linux-x64.tar.gz
3.在/etc/profile中配置环境变量
sudo vim /etc/profile #将下面内容复制进去 export JAVA_HOME=/data/home/cbbgs/software/jdk1.8.0_221 export JRE_HOME=${JAVA_HOME}/jre export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib export PATH=${JAVA_HOME}/bin:$PATH
4.让文件生效
source /etc/profile
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)