https://www.oracle.com/java/
https://www.oracle.com/cn/java/technologies/javase-downloads.html
如图:
点击jdk download,进入下载页面:如图:
我们选择这个包下载: jdk-15_linux-x64_bin.tar.gz
选中 同意技术许可协议,
然后点击 下载 按钮
说明:如果拿到安装包的下载地址后,也可以从服务器上直接下载:
[root@blog ~]# cd /usr/local/source [root@blog source]# mkdir jdk [root@blog source]# cd jdk [root@blog jdk]# wget https://download.oracle.com/otn-pub/java/jdk/15+36/779bf45e88a44cbd9ea6621d33e33db1/jdk-15_linux-x64_bin.tar.gz?AuthParam=1600661691_2c068f0678a8396b65cf132c02446e2a --2020-09-21 12:13:38-- https://download.oracle.com/otn-pub/java/jdk/15+36/779bf45e88a44cbd9ea6621d33e33db1/jdk-15_linux-x64_bin.tar.gz?AuthParam=1600661691_2c068f0678a8396b65cf132c02446e2a Resolving download.oracle.com (download.oracle.com)... 23.211.96.11 Connecting to download.oracle.com (download.oracle.com)|23.211.96.11|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 188017890 (179M) [application/x-gzip] Saving to: ‘jdk-15_linux-x64_bin.tar.gz?AuthParam=1600661691_2c068f0678a8396b65cf132c02446e2a’ jdk-15_linux-x64_bin.tar.gz?AuthParam=16006 100%[==========================================================================================>] 179.31M 12.0MB/s in 14s 2020-09-21 12:13:52 (12.7 MB/s) - ‘jdk-15_linux-x64_bin.tar.gz?AuthParam=1600661691_2c068f0678a8396b65cf132c02446e2a’ saved [188017890/188017890] [root@blog jdk]# ls ‘jdk-15_linux-x64_bin.tar.gz?AuthParam=1600661691_2c068f0678a8396b65cf132c02446e2a‘ [root@blog jdk]# mv jdk-15_linux-x64_bin.tar.gz\?AuthParam\=1600661691_2c068f0678a8396b65cf132c02446e2a jdk-15_linux-x64_bin.tar.gz
说明:刘宏缔的架构森林是一个专注架构的博客,地址:https://www.cnblogs.com/architectforest
对应的源码可以访问这里获取: https://github.com/liuhongdi/
说明:作者:刘宏缔 邮箱: 371125307@qq.com
[root@blog jdk]# tar -zxvf jdk-15_linux-x64_bin.tar.gz
[root@blog jdk]# mv jdk-15 /usr/local/soft/
编辑profile文件,把命令保存到文件中
[root@blog jdk]# vi /etc/profile
export JAVA_HOME=/usr/local/soft/jdk-15 export CLASSPATH=.:$JAVA_HOME/lib export PATH=$PATH:$JAVA_HOME/bin
说明:jdk默认已不再包含jre环境,且生产环境中很少用到,
我们不再手动创建jre程序,也不再手动配置其环境变量
[root@blog jdk]# source /etc/profile
[root@blog jdk]# java --version java 15 2020-09-15 Java(TM) SE Runtime Environment (build 15+36-1562) Java HotSpot(TM) 64-Bit Server VM (build 15+36-1562, mixed mode, sharing)
可以看到java的版本:15
[root@blog jdk]# cat /etc/redhat-release CentOS Linux release 8.0.1905 (Core)
linux(centos8):安装java jdk 15 (java 15)
原文:https://www.cnblogs.com/architectforest/p/13704880.html