1、下载:jdk1.8.0_131-linux-64.tar.gz
2、解压:tar -zxvf jdk1.8.0_131-linux-64.tar.gz
3、修改环境变量:vi /etc/profile
到文件最低部添加:
export JAVA_HOME=/opt/java/jdk1.8
export PATH=$PATH:$JAVA_HOME/bin
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
4、环境变量立即生效:source /etc/profile
5、验证是否安装成功:java -version
标签:Jdk1.8,JAVA,tar,jdk1.8,export,Linux,HOME,安装 From: https://www.cnblogs.com/zhey/p/16985803.html