VB.net 2010 视频教程 VB.net 2010 视频教程 python基础视频教程
SQL Server 2008 视频教程 c#入门经典教程 Visual Basic从门到精通视频教程
当前位置:
首页 > 编程开发 > Java教程 >
  • 码农飞升记-05-JDK11安装包的下载安装方式以及环境变量的配置

1.下载 JDK 11 安装包

由于目前想要在 Oracle 官网下载 OracleJDK 都需要一个 Oracle 账户,没账户的朋友可以需要去创建一个(后续下载 OracleJDK 的时候会用到)。

准备 Oracle 账户

前往 Oracle 官网,你会看到以下界面。

  1. 选择单击页面顶部的查看账户(View Accounts),在Oracle 账户(Oracle Account)下:
    • 没有账户的朋友点击创建账户(Create an Account),进入创建账户页面。
    • 有账户的朋友可以直接选择单击登录(Sign-In),进入登录页面。

00-Log-in.png (1903×1040) (gitee.com)

因为创建账户会多一个步骤,为了更好地演示,这里博主先选择创建账户。

创建 Oracle 账户

  1. 按照表格的提示填写好对应的信息
  2. 点击创建账户(Create Account),返回主页界面。

01-Sign-in.png (1903×1203) (gitee.com)

登录 Oracle 账户

成功创建账户之后,再进入登录页面。

  1. 输入用户名
  2. 输入密码
  3. 点击登录(Sign in),返回主页界面。

02-Log-in-Oracle.png (1908×1040) (gitee.com)

成功登录后会自动返回主页。

选择 OracleJDK 版本

进入 OracleJDK 版本页面

单击主页上方的产品(Products)

03-Oracle.png (1903×1040) (gitee.com)

单击选择软件(Software)下的 Java,进入 Java 页面。

04-OracleFindJava.png (1903×1040) (gitee.com)

单击右边的下载 Java(Download Java),进入OracleJDK 选择页面。

05-DownloadJava.png (1904×1040) (gitee.com)

单击中间 Java SE 11 下的 Oracle JDK 下的 JDK Download,进入正式下载页面。

06-FindJDK.png (1601×4231) (gitee.com)

OracleJDK 11 版本区别

虽然前面的章节中有提到,但是以防有新来的朋友不知道,这里还是再提一下。

Java SE 9 以及之后版本的发布节奏和不同版本的差距

根据 Java Platform Group 产品管理高级总监 Donald Smith 在" Update and FAQ on the Java SE Release Cadence "中的描述以及 Oracle Java SE Support Roadmap 的描述,提炼出我们需要的部分:从 Java SE 9 开始 Java 开启了一个新的版本控制和发布节奏模型。

Q1: Surely you can’t expect everyone to adopt major releases every six months?!

There are no “major releases” per se any more; that is now a legacy term. Instead there is a steady stream of “feature releases.” This is consistent with how many releases have been done in the past, except with a new take on versioning. For example, Java 8 launched in March 2014. 8u20, a feature release, was released almost six months later in August. 8u40, the next feature release, was released almost six months after that.

So yes, we expect an uptake of “feature releases” every six months, just as before.

Going from Java 9->10->11 is closer to going from 8->8u20->8u40 than from 7->8->9. It’s scary to see at first when you’re used to major releases about every three years and have a mental model of the huge impact of those major changes. The six-month cadence is not that. Later in the FAQ we’ll provide more specific proof of this.

Q2: If the new releases are basically the long standing six-month cadence, why rev the major release number each time? Why not just call it 9u20, 9u40, etc.?

By having streamlined some JCP processes, it’s now possible to introduce new class library, JVM and language features such as Local-Variable Type Inference in just six months, instead of having to wait years for a “major release.” Rather than releasing dozens of large changes to the specifications every couple of years, they can be more pragmatically introduced in a steady stream as soon as they are ready for adoption.

Q5: I’m still not convinced. Java 9 was a challenge to adopt, so that means 10 and 11 will be, too.

Many Java SE developers and user have historically waited for a couple of updates before adopting a new “major version.” This could be expected when there were dozens of major new spec-changing features in a “major” release, but won’t be the case going forward with six-month releases. This has not been the case since Java SE 9.

For example, the Java SE 9 release incorporated approximately 19,000 source code changes on top of Java SE 8. There were only 2,700 such changes between Java 9 and Java 10 – approximately the same as between Java 8 and Java 8u40. So while Java SE 9 was a “major” upgrade compared to Java SE 8, we have already seen that Java SE 10 is a simple feature update to Java SE 9.

Q7: Ok, but I don’t want new features. I have a system in production and just want stability, performance and security updates only. What do I do?

At Oracle, our intent is to designate releases every three years as “Long Term Support” (LTS) releases starting with Java SE 11 in September 2018. So while Java SE 9 has reached its End of Life with the release of Java 10, and Java 10 will do the same with the release of Java 11, Java 11 will have commercial support from Oracle available for at least eight additional years.

As has happened for almost a decade with Java 6 and Java 7 (and likely Java 8 in 2019), once Oracle stops contributing our source code changes to a particular release series in OpenJDK, so that we can focus on the needs of our customers, other qualified contributors in the OpenJDK Community may step in to continue to maintain the release series. They do so in accordance with OpenJDK Community standards for as long as they choose, backporting the relevant changes from later releases still maintained by Oracle and others. For example, for JDK 6, Sun established the project in 2008, and Oracle continued to maintain it until 2013. Other maintainers then continued working on the project by backporting updates from later releases.

Oracle supports such transitions in the OpenJDK Community by providing an established process for them to take place within the JDK Updates Project, as well as assistance to new maintainers to settle in their new roles, and last but not least, the Vulnerability Group.

Oracle Java SE Product Releases

Oracle provides Customers with Oracle Premier Support on Oracle Java SE products as described in the Oracle Lifetime Support Policy. For product releases after Java SE 8, Oracle will designate a release, every three years, as a Long-Term-Support (LTS) release. Java SE 11 is an LTS release. For the purposes of Oracle Premier Support, non‑LTS releases are considered a cumulative set of implementation enhancements of the most recent LTS release. Once a new feature release is made available, any previous non‑LTS release will be considered superseded. For example, Java SE 9 was a non‑LTS release and immediately superseded by Java SE 10 (also non‑LTS), Java SE 10 in turn is immediately superseded by Java SE 11. Java SE 11 however is an LTS release, and therefore Oracle Customers will receive Oracle Premier Support and periodic update releases, even though Java SE 12 was released.

1.发布的版本区别

LTS版本(Long Term Support,长期支持版本),提供至少八年的商业支持(根据市场需要有可能会延长),到期后会被新的 LTS 版本取代。

non-LTS版本(non Long Term Support,非长期支持版本),提供六个月的商业支持,到期后会被新发布的版本取代。

2.发布周期

整体发布周期为每六个月发布一版,其中:

LTS版本:每三年发布一版

non-LTS版本:每六个月发布一版

PS:

  • 当二者发布时间冲突时,优先发布LTS版本,non-LTS版本向后推迟一个周期。
3.版本的关系

版本内的更新:例如:Java 11 > Java 11.0.1 > Java 11.0.2,大多是对一些安全漏洞的修复,版本间差距几乎没有(除安全漏洞外)。

版本间的更新:例如:Java 9 > Java 10 >Java 11更接近于从 Java 8 > 8u20 > 8u40,每六个月发布一次的 non-LTS 版本更像"主要版本"的"功能发布",LTS版本更像是主要版本,而non-LTS版本更像是包含上一个LTS版本的测试版本,版本间差距较大。

2019年4月16日 以及之后发布的 OracleJDK 版本的许可证

2019年4月16日以及之前发布的 OracleJDK 版本是 Binary Code License

2019年4月16日以及之后发布的 OracleJDK 版本使用的是 Java SE OTN License

因为这两个许可证有着巨大的区别,根据这两个许可证长篇累牍的描述结合 RednaxelaFX 在 Oracle 终于要向 Java 的非付费用户开枪了-怎么看?和采用java开发商业软件需要给Oracle付钱吗?两个问题的回答提炼出了几个要点。

许可证 免费学习 免费个人使用 免费开发 免费测试 免费商业功能 免费商业使用 免费在台式机/笔记本上使用 免费在服务器上使用 免费嵌入式设备和其他计算环境上使用
Binary Code License
Java SE OTN License -

PS:

  • 商业功能指的是 Oracle JDK 自带的 HotSpot VM 的启动参数中是否有 -XX:+UnlockCommercialFeatures,如果有 -XX:+UnlockCommercialFeatures 就代表启动了商业功能,这个功能默认是关闭状态,需要手动开启(在 Java 11 中被废除)。
  • Java Flight Recorder(JFR) 已经加入 Open JDK 11,在 Open JDK 11/bin 下可以直接启动,或者在 HotSpot VM 的启动参数中加上 -XX:StartFlightRecording。

采用 Binary Code License 的 OracleJDK 10 及其之前的版本(包含OracleJDK 8u201/8u202及其以前版本,不包含 OracleJDK 8u211/8u212及其以后版本),个人使用和商用几乎是免费的(不使用商业功能和嵌入式设备的情况下)。

采用 Java SE OTN License 的 OracleJDK 11 及其之后的版本(包含 OracleJDK 8u211/8u212及其以后版本,不包含 OracleJDK 8u201/8u202及其以前版本),个人使用免费,商用就要购买许可证才可以(虽然可以偷偷商用,不过那种操作就跟裸奔过雷区一样,你也不知道啥时候会灰飞烟灭,也不知道 Oracle 会不会等养肥了再宰。若想使用免费商用的 Java 11及其之后版本,可以使用其他厂商提供的 OpenJDK builds,参考---OpenJDK是什么?)。

选择适合自己的 OracleJDK 11 版本

选择与自己的操作系统相匹配的版本,点击下载图标

07-FindJDK11.0.11.png (1600×2387) (gitee.com)

  1. 在弹出的对话框中勾选接受协议
  2. 点击下载按钮

如果没有提前登录 Oracle 账户的话,这里点击了下载之后会跳转到登录页面,然后成功登录 Oracle 账户之后会自动开始下载。

如果在一开始登录了 Oracle 账户的话,这里点击下载,会直接开始下载。

08-Download.png (1906×1040) (gitee.com)

现在等待 OracleJDK 下载完成即可,在等待它下载的期间,可以先继续往下检查环境变量情况。

2.安装 JDK 11 安装包

在正式安装 JDK 之前,要先检查一下电脑的环境变量。

检查环境变量 Path 列表

  1. 单击开始菜单
  2. 点击设置(Settings),进入设置界面。

10-Settings.png (647×681) (gitee.com)

单击系统(System),进入系统设置界面。

10-SystemSettings.png (1200×902) (gitee.com)

  1. 单击关于(About)
  2. 点击高级系统设置(Advanced system settings),进入高级设置页面。

11-System-About.png (1200×902) (gitee.com)

  1. 点击高级(Advanced)
  2. 单击环境变量(Environment Variables),进入环境变量界面。

12-AdvancedSystemSettings.png (412×468) (gitee.com)

双击 Path(单击一下 Path 之后单击编辑(Edit)),进入 Path 列表。

13-EnvironmentVariables.png (618×585) (gitee.com)

  • 检查 Path 列表已有的路径中是否有包含 Java 的路径:
    • 如果 Path 列表已有的路径中有包含 Java 的路径,则代表当前计算机曾经配置过 Java,根据 Path 列表中的路径,去找到对应文件夹:
      • 如果对应文件夹内存在 Java 相关文件,则代表当前计算机已经配置了 Java 版本(自行决定是否需要再多安装配置一个 Java 版本,或是将以前的 Java 卸载重新安装)。
        • 如果需要再多安装配置一个 Java 版本---JDK多环境配置
        • 如果需要卸载 Java 版本
          • JDK 安装包版本
            1. 在计算机的应用程序设置中卸载环境变量 Path 列表已有的路径中有包含 Java 的路径所指的 JDK。
            2. 删除环境变量 Path 列表中的该失效路径(环境变量 Path 列表已有的路径中有包含 Java 的路径)。
          • JDK 压缩包版本
            1. 进入环境变量 Path 列表已有的路径中有包含 Java 的路径,将该路径下所有文件删除。
            2. 删除环境变量 Path 列表中的该失效路径(环境变量 Path 列表已有的路径中有包含 Java 的路径)。
      • 如果对应文件夹不存在或者文件夹内没有 Java 相关文件,则代表当前计算机没有配置 Java,但曾经安装/配置过 Java。建议删除该失效路径(环境变量 Path 列表已有的路径中有包含 Java 的路径):
        1. 单击选中该路径
        2. 点击右侧的删除(Delete),删除该路径。
    • 如果 Path 列表已有的路径中没有包含 Java 的路径,则代表当前计算机没有配置 Java。

关闭已经打开的这些窗口,清空桌面(不是移开水杯,擦桌子之类的哦!


相关教程