下載,選擇centos7 64位版本html
https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
解壓java
tar -zxvf jdk-8u202-linux-x64.tar.gz
移動目錄linux
sudo mkdir /usr/local/java
sudo mv ~/jdk1.8.0_202 /usr/local/java/
環境配置centos
vi /etc/profile
寫入以下內容oracle
export JAVA_HOME=/usr/local/java/jdk1.8.0_202
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/binui
使之生效centos7
source /etc/profile
驗證spa
[root@localhost java]# java -version java version "1.8.0_202" Java(TM) SE Runtime Environment (build 1.8.0_202-b08) Java HotSpot(TM) 64-Bit Server VM (build 25.202-b08, mixed mode)
到此,配置完成!code