Java 8 更新 151 还是 152?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/46928088/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Java 8 update 151 or 152?
提问by Aaron Digulla
There are two Java 8 downloads on the Oracle page.
The release notes of 152note two things over 151:
- BigInteger performance improvements
- Compilers accept modification of final fields outside initializer methods
- BigInteger 性能改进
- 编译器接受初始化方法之外的最终字段的修改
The latter seems more like a comment along the lines "this is a bug but not fixed in 8; it will be fixed in Java 9". So this also applies to version 151 even though it's not mentioned.
后者似乎更像是“这是一个错误,但在 8 中未修复;它将在 Java 9 中修复”的注释。所以这也适用于版本 151,即使它没有被提及。
I'm unsure about the former. Why isn't this in 151? I find this very frustrating. Two versions without a clear indication which one is "better" or the "preferred" version for most developers.
我不确定前者。为什么这不是在 151 中?我觉得这非常令人沮丧。两个版本没有明确说明哪个版本对大多数开发人员来说“更好”或“首选”版本。
Hence my question: Is it better to use 152 in production or 151? Are there any indicators which I could or should be using to decide?
因此我的问题是:在生产中使用 152 还是 151 更好?我可以或应该使用任何指标来决定吗?
回答by varren
The general idea is that
一般的想法是
- 8u151 (tag jdk8u151-b12) is a Critical Patch Update (CPU) Release
- 8u152 (tag jdk8u152-b16) is a Patch Set Update (PSU) Release
- 8u151(标记jdk8u151-b12)是一个重要补丁更新 (CPU) 版本
- 8u152(标记jdk8u152-b16)是补丁集更新 (PSU) 版本
From official Oracle CPU and PSU Releases Explained
来自官方 Oracle CPU 和 PSU 版本的解释
Starting with the release of Java SE 7 Update 71 (Java SE 7u71) in October 2014, Oracle will release a Critical Patch Update (CPU) at the same time as a corresponding Patch Set Update (PSU) for Java SE 7.
Which Java version should I choose: the CPU or the PSU?Oracle strongly recommends that all Java SE users upgrade to the latest CPU release available for a release family. Most users should choose the CPU release.
Users should only use the corresponding PSU release if they are being impacted by one of the additional bugs fixed in that version as noted in the release notes.
The subsequent CPU release will contain all of the fixes from the current PSU. For this reason, organizations should test the current PSU in their environment in anticipation of these fixes being included in the next CPU.
What is the difference between a Java CPU and PSU release?Java SE Critical Patch Updates (CPU) contain fixes to security vulnerabilities and critical bug fixes. Oracle strongly recommends that all Java SE users upgrade to the latest CPU releases as they are made available. Java SE CPU releases are odd numbered versions (i.e. 7u71, 7u65 – see more on Java SE version numbering schemes here).
Java SE Patch Set Updates (PSU) contain all of fixes in the corresponding CPU, as well as additional non-critical fixes. Java PSU releases should only be used if you are being impacted by one of the additional bugs fixed in that version. The release notes call out the additional fixes available in Java SE PSU releases.
PSU releases provide organizations and developers with access to non-critical fixes in addition to the critical fixes contained in the corresponding CPU.
从 2014 年 10 月发布 Java SE 7 Update 71 (Java SE 7u71) 开始,Oracle 将在发布 Java SE 7 的相应补丁集更新 (PSU) 的同时发布重要补丁更新 (CPU)。
我应该选择哪个 Java 版本:CPU 还是 PSU?Oracle 强烈建议所有 Java SE 用户升级到发布系列可用的最新 CPU 版本。大多数用户应该选择 CPU 版本。
如发行说明中所述,用户应仅在受到该版本中修复的其他错误之一的影响时才使用相应的 PSU 版本。
后续 CPU 版本将包含当前 PSU 的所有修复。出于这个原因,组织应该在他们的环境中测试当前的 PSU,以期在下一个 CPU 中包含这些修复程序。
Java CPU 和 PSU 版本之间有什么区别?Java SE 重要补丁更新 (CPU) 包含对安全漏洞和关键错误修复的修复。Oracle 强烈建议所有 Java SE 用户升级到可用的最新 CPU 版本。Java SE CPU 发行版是奇数版本(即 7u71、7u65 – 在此处查看有关 Java SE 版本编号方案的更多信息)。
Java SE 补丁集更新 (PSU) 包含相应 CPU 中的所有修复以及其他非关键修复。仅当您受到该版本中修复的其他错误之一的影响时,才应使用 Java PSU 版本。发行说明列出了 Java SE PSU 发行版中可用的其他修复程序。
除了相应 CPU 中包含的关键修复程序之外,PSU 版本还为组织和开发人员提供了对非关键修复程序的访问。
Also read What's the difference between odd and even Java updates?
另请阅读 奇数和偶数 Java 更新有什么区别?
To find full list of public bug fixes you need to open Bug Fixes page at the bottom of the release notes.
要找到完整的公共错误修复列表,您需要打开发行说明底部的错误修复页面。
- 8u152-relnotesor Wiki: Security fixes, 1 new feature, 1 change and 238 bug fixesfrom 8u151.
- 8u151-relnotesor Wiki: Security fixes, 2 notes, 1 certificate revocation, 1 new feature, 6 changes and 24 bug fixesfrom 8u144.
- 8u152-relnotes或Wiki:来自 8u151 的安全修复、1 个新功能、1 个更改和238 个错误修复。
- 8u151-relnotes或Wiki:来自 8u144 的安全修复、2 个注释、1 个证书撤销、1 个新功能、6 个更改和24 个错误修复。
So there are 238 bug fixes in the PSU (8u152) (not only BigInteger performance improvements). And there is high probability that you are going to get most of them anyway in the next CPU release. So it is recommended to update as fast as you can to the 8u151 and test/adjust you code for comparability with 8u152. You can update to 8u152 if you actually need some bugfix there.
因此 PSU (8u152) 中有 238 个错误修复(不仅是 BigInteger 性能改进)。而且很有可能在下一个 CPU 版本中您将获得其中的大部分。因此,建议尽快更新到 8u151 并测试/调整您的代码以与 8u152 进行可比性。如果您确实需要在那里进行一些错误修复,则可以更新到 8u152。
回答by jayaram S
Per Oracle download pages
每个 Oracle 下载页面
Java SE 8u151 includes important bug fixes. Oracle strongly recommends that all Java SE 8 users upgrade to this release. Java SE 8u152 is a patch-set update, including all of 8u151 plus additional features (described in the release notes).
Java SE 8u151 包括重要的错误修复。Oracle 强烈建议所有 Java SE 8 用户升级到此版本。Java SE 8u152 是一个补丁集更新,包括所有 8u151 以及附加功能(在发行说明中描述)。
What this means for practical purposes is that if you are reliant on say jdk8u144 for your application, you can upgrade to 151 and expect nothing to break.
出于实际目的,这意味着如果您的应用程序依赖 jdk8u144,您可以升级到 151,并且不会有任何问题。
But if you are going to upgrade and don't particularly care about the enhancements included in 152, you can go ahead.
但是,如果您要升级并且不是特别关心 152 中包含的增强功能,则可以继续。
If your application relies on BigInteger for example as in some financial applications, this may be a big deal and may warrant some level of integration testing.
如果您的应用程序依赖 BigInteger,例如在某些金融应用程序中,这可能是一个大问题,并且可能需要进行某种程度的集成测试。
回答by Aaron Digulla
I have two reasons to prefer 8u151:
我有两个理由更喜欢 8u151:
The desktop Java updater for Windows updates to 8u151 when I ask it to check for updates. I interpret that as "Oracle believes that is the version which most people want/should have".
The BigInteger performance improvements seem to be the only difference between 151 and 152. If that change was well tested and ready for production, Oracle would have rolled it into 151 to avoid confusion. They didn't.
当我要求 Windows 的桌面 Java 更新程序检查更新时,它会更新到 8u151。我将其解释为“Oracle 认为这是大多数人想要/应该拥有的版本”。
BigInteger 性能改进似乎是 151 和 152 之间的唯一区别。如果该更改经过充分测试并准备好用于生产,Oracle 会将其纳入 151 以避免混淆。他们没有。
回答by Stephen C
In general, here is how I think one should chose between a CPU or a PSU ... based on the Oracle CPU and PSU Releases Explainedpage (quoted above).
一般来说,根据 Oracle CPU 和 PSU 版本说明页面(上文引用),我认为应该如何在 CPU 或 PSU 之间进行选择。
If you have critical Java applications1, initially choose the CPU over the PSU. A CPU has the lesser risk of the upgrade breaking your application.
You should then plan to upgrade to the PSU soon. The reason is that the next CPU release will most likelyinclude the enhancements in this PSU. If you skip the PSU in this upgrade cycle, you are putting off finding / fixing any unexpected breakages until the next (mandatory) CPU. You cannot predict whether that will cause problems.
Otherwise, if you need the listed enhancements of the PSU, choose the PSU over the CPU.
If neither of the above applies, it doesn't matter which you chose.
如果您有关键的 Java 应用程序1,请首先选择 CPU 而不是 PSU。CPU 升级破坏应用程序的风险较小。
那么你应该计划升级到PSU很快。原因是下一个 CPU 版本很可能会包含此 PSU 中的增强功能。如果您在此升级周期中跳过 PSU,您将推迟查找/修复任何意外损坏,直到下一个(强制性)CPU。您无法预测这是否会导致问题。
否则,如果您需要列出的 PSU 增强功能,请选择 PSU 而不是 CPU。
如果以上都不适用,那么您选择哪个都没有关系。
Note that this is the picture if you don't have a support contract. If you have a support contract, there may beother options; e.g. paying for Oracle to spin you custom security patches that might allow you to put off installing the enhancements ... indefinitely.
请注意,如果您没有支持合同,则这是图片。如果您有支持合同,可能还有其他选择;例如,支付 Oracle 的费用来旋转您的自定义安全补丁,这可能会让您无限期地推迟安装增强功能。
Note also that is an idealized decision making process. In practice, software / devops engineers often have to balance competing risks and schedules without the resources to do a proper job.
另请注意,这是一个理想化的决策过程。在实践中,软件 / DevOps 工程师通常不得不平衡竞争风险和日程安排,而没有资源来完成正确的工作。
On the topic of why Oracle can't give you clear advice ....
关于Oracle为什么不能给你明确建议的话题....
They can't know for sure that the
BigInteger
performance upgrades won't break your code.They do know that the compiler fixes couldchange behavior of certain peoples' (broken) code. But there is no easy way to identify that broken code a priori.
他们无法确定
BigInteger
性能升级不会破坏您的代码。他们确实知道编译器修复程序可能会改变某些人(损坏的)代码的行为。但是没有简单的方法可以先验地识别出损坏的代码。
In neither case do they know if the PSU changes will affect you. The information is in the release notes to allow you to decide. They haven't provided you an explicit decision tree ... but given the nature of the changes the most practical approach is to "try it out".
在这两种情况下,他们都不知道 PSU 的变化是否会影响到您。该信息位于发行说明中,供您决定。他们没有为您提供明确的决策树……但考虑到更改的性质,最实用的方法是“尝试一下”。
And this also explains why "the most knowledgeable group of people on Earth2"cannot give clear advice either. There is no definitive answer.
这也解释了为什么“地球2上知识最渊博的一群人”也不能给出明确的建议。没有确定的答案。
1 - Critical could mean safety critical, security critical, critical to your organization's business, critical to your customers' business. Your call.
1 - 关键可能意味着安全关键、安全关键、对组织的业务至关重要、对客户的业务至关重要。您的来电。
2 - Pull the other one: it's got bells on!
2 - 拉另一个:它有铃铛!