Linux Java 安装
1.解压缩Java
tar -zxvf jdk-8u151-linux-x64.tar.gz
2.配置环境变量
vi /etc/profile set java environment JAVA_HOME=/usr/local/java/jdk1.8.0_301 JRE_HOME=/usr/local/java/jdk1.8.0_301/jre CLASS_PATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin export JAVA_HOME JRE_HOME CLASS_PATH PATH
3.加载配置
source /etc/profilec
4.测试
java -version