32

There are two Java 8 downloads on the Oracle page.

The release notes of 152 note two things over 151:

  • BigInteger performance improvements
  • Compilers accept modification of final fields outside initializer methods

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.

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.

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?

Bax
  • 4,260
  • 5
  • 43
  • 65
Aaron Digulla
  • 321,842
  • 108
  • 597
  • 820
  • I had a feeling this would get closed... unless you are generating byte code by hand(ASM?), this should not matter as far as I can see. – Eugene Oct 25 '17 at 09:01
  • The question I would have asked myself over this would have been - Do I need the change as mentioned in the release note for my service/application? – Naman Oct 25 '17 at 09:01
  • 3
    btw that same page says some "notable bug fixes"... I would absolutely go with `152` – Eugene Oct 25 '17 at 09:04
  • 1
    I find this very frustrating. Two versions, no clear indication which one is "better" or how to decide this. – Aaron Digulla Oct 25 '17 at 12:59
  • @Eugene But the text says "this only applies to Java 9". I don't understand why they mention this under "bug fixes" because it's not fixed in Java 8! – Aaron Digulla Oct 25 '17 at 13:04
  • I'll have to agree... may be there was some infrastructure added for *when* java-9 is out to use that? I can't tell though – Eugene Oct 25 '17 at 13:05
  • *"I find this very frustrating."* - Talk to Oracle about this. If you have a support contract they may listen :-) – Stephen C Nov 05 '17 at 00:07
  • Actually ... that aside is one of the reasons that this is "opinion-based". It is inviting people to "air their opinions" on a topic that is clearly a matter of opinion, not fact. – Stephen C Nov 05 '17 at 00:30
  • Editorial content should not be part of your question. – Hovercraft Full Of Eels Nov 30 '17 at 17:29
  • @HovercraftFullOfEels I had several people voting to close the question and I had to stop them somehow. So the content was necessary. I just wish there was a way to say "this guy clearly didn't understand the question so his vote to close should be disegarded". – Aaron Digulla Dec 08 '17 at 14:10

4 Answers4

53

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

From official Oracle CPU and PSU Releases Explained

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.

Also read What's the difference between odd and even Java updates?


To find full list of public bug fixes you need to open Bug Fixes page at the bottom of the release notes.


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.

varren
  • 14,551
  • 2
  • 41
  • 72
  • 1
    "Most users should choose the CPU release." Exactly. So to the OP, 151 is the "preferred" version that you were looking for. – Zac Thompson Nov 03 '17 at 18:26
  • 10
    Frankly, this dual-release scheme incredibly messes me up every time, and I'm probably far from being the only one confused. Furthermore the documentation about this is very sporadic, and currently it's just nonexistent around the download page. Hope they'll consider dropping this scheme and going to something more conventional. – Gras Double Nov 13 '17 at 02:30
  • Yes, "Take the PSU only if you have experienced one of those bugs" instead of "Take the PSU to AVOID experiencing those 238 bugs" is a bit strange. – Pino Dec 14 '17 at 16:15
6

Per Oracle download pages

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).

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.

But if you are going to upgrade and don't particularly care about the enhancements included in 152, you can go ahead.

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.

jayaram S
  • 580
  • 6
  • 13
3

I have two reasons to prefer 8u151:

  1. 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".

  2. 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.

Aaron Digulla
  • 321,842
  • 108
  • 597
  • 820
  • A comment about the performance. It just says it is enabled by default. It does not say they weren't already available and ready for production. Both referenced bugs are actually from 2015. – sebastianf182 Nov 05 '17 at 04:28
3

In general, here is how I think one should chose between a CPU or a PSU ... based on the Oracle CPU and PSU Releases Explained page (quoted above).

  • 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 likely include 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.

Note that this is the picture if you don't have a support contract. If you have a support contract, there may be other options; e.g. paying for Oracle to spin you custom security patches that might allow you to put off installing the enhancements ... indefinitely.

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.


On the topic of why Oracle can't give you clear advice ....

  • They can't know for sure that the BigInteger performance upgrades won't break your code.

  • They do know that the compiler fixes could change behavior of certain peoples' (broken) code. But there is no easy way to identify that broken code a priori.

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".

And this also explains why "the most knowledgeable group of people on Earth2" cannot give clear advice either. There is no definitive answer.


1 - Critical could mean safety critical, security critical, critical to your organization's business, critical to your customers' business. Your call.

2 - Pull the other one: it's got bells on!

Stephen C
  • 698,415
  • 94
  • 811
  • 1,216