下載地址:https://www.oracle.com/java/technologies/javase-downloads.htmlhtml
歷史版本:https://www.oracle.com/java/technologies/oracle-java-archive-downloads.htmljava
這裏稍微多說一句,下載地址偶爾是會變更的,上面的地址是截止到這片文章發佈時的最新連接;可是通常Oracle都會作兼容(若是上面的連接失效了,點開後通常會重定向到對應的新地址),下載界面也可能會隨着網站總體UI而更新,但都是大同小異,進到Oracle官網按照導航找到須要的JDK版本並非很難linux
shell> mkdir /usr/local/java shell> cd /usr/local/java shell> tar -zxvf /tools/jdk-8u241-linux-x64.tar.gz shell> ll total 4 drwxr-xr-x 7 10143 10143 4096 Dec 11 18:39 jdk1.8.0_241
除此以外,還能夠經過yum、rpm方式安裝,解壓的方式雖然不像yum、rpm那麼方便(其實也很方便了),可是更爲通用和「乾淨」,相似Windows的「綠色版」軟件shell
shell> vim /etc/profile
文件末尾增長如下配置vim
# JDK export JAVA_HOME=/usr/local/java/jdk1.8.0_241 export PATH=$JAVA_HOME/bin:$PATH export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
使配置生效bash
source /etc/profile
shell> java -version java version "1.8.0_241" Java(TM) SE Runtime Environment (build 1.8.0_241-b07) Java HotSpot(TM) 64-Bit Server VM (build 25.241-b07, mixed mode)