前言:開發程序須要使用到SunJDK,衆所周知SunJDK是ORACLE的JDK,通常很差下載,除非你有用戶,你也能夠註冊一個,也能夠到其餘地方下載(這裏附上官方連接)
https://www.oracle.com/java/technologies/javase-jdk8-downloads.html
Warning:下載分ARM和X86的架構注意分清楚,須要查看本地是否安裝openjdk(若是有的話須要卸載,防止衝突)html
1.下載JDK(能夠使用Linux的wget下載,這裏建議使用windows的IDM下載)
2.創建工做目錄以及解壓壓縮包java
[root@localhost ~] mkdir /usr/local/java [root@localhost ~] tar zxvf jdk-8u162-linux-arm64-vfp-hflt.tar.gz -C /usr/local/java
3.配置環境變量(在末尾加入)linux
[root@localhost ~] vim /etc/profile export JAVA_HOME=/usr/java/jdk1.8.0_162 export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar export PATH=$JAVA_HOME/bin:$PATH [root@localhost ~] source /etc/profile
4.建立快捷命令訪問vim
[root@localhost ~] ln -s /usr/java/jdk1.8.0_162/bin/java /usr/local/bin/java
5.驗證windows
[root@localhost ~] java -version java version "1.8.0_65" Java(TM) SE Runtime Environment (build 1.8.0_65-b17) Java HotSpot(TM) Server VM (build 25.65-b01, mixed mode)