JDK的二进制安装步骤
1. Jdk1.8二进制包下载路径http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
2. 解压到对应安装目录/usr/local/或者/opt/
3. 验证安装/usr/local/jdk1.8.0_211/bin/java -version
1.安装命令
cd /data/tools/
tar -zxf jdk-8u211-linux-x64.tar.gz
mv jdk1.8.0_211 /usr/local/
2.配置Java环境变量
vim /etc/profile
export JAVA_HOME=/usr/local/jdk1.8.0_211/
export PATH=$PATH:$JAVA_HOME/bin
export CLASSPATH=.:$JAVA_HOME/lib/tools.jar:$JAVA_HOME/lib/dt.jar:$CLASSPATH
export JAVA_HOME ##JAVA 家目录
export PATH ##JAVA命令路径
export CLASSPATH ##运行JAVA系统参数
source /etc/profile ###立即生效环境变量
3.验证环境变量
java -version
java version "1.8.0_211"
Java(TM) SE Runtime Environment (build 1.8.0_211-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.211-b12, mixed mode)