Live data from Hacker News

Which version of JDK should I use?

whichjdk.com

31–40 of 258 posts

Re: Which version of JDK should I use?

#31
post #23

The general guidance is always use the last LTS release unless there is a specific feature in the non LTS releases that you can’t wait for. So any new development should target 17 at this point. Unless you want serious long term pain then you shouldn’t be more than one LTS release behind. So if you are not running on JDK 11 or later you should be strongly thinking about upgrading.

Why should I stick to LTS? All other versions aren't in any way less tested, you should always stick to the newest released JDK version, be it LTS or not, this way you get all the benefits (language features, performance gains) and security ones (security fixes always first land in the newest version, and are backported to the older ones). Upgrades now are pretty straightforward if you are past JKD 9 - with JDK 16-17…

> All other versions aren't in any way less tested

That depends. If most people follow the advice of "sticking to LTS", these versions will have way more users, and thus will be more "battle-tested", as in tested in production.

Re: Which version of JDK should I use?

#36

It really is quite incredible what a mess has made of the clear stability of Java and what to get since Oracle took over.

When Oracle acquired Sun in 2010-11, Sun had not shipped a new release of Java in more than four years.[0] That's hardly a "stability" worth treasuring.

Since then, Oracle completely open-sourced the JDK and the associated tools and gave the the compatibility kits to the community to use. The result is that there are now several different distributions of the JDK. This is undeniably a good thing.

As to the 6-month release cycle, it allows the community to get new features on a much faster cadence than any of the other major languages. If it's too fast for your preferred way of doing things, stick with the LTS releases, which come out on a three-year cycle and include all the features from the prior releases.

There might be reasons not to like Oracle, but their stewardship of Java has been pretty good.

[0] https://en.wikipedia.org/wiki/Java_version_history

Re: Which version of JDK should I use?

#37
post #23

Earlier quoted context omitted.

Why should I stick to LTS? All other versions aren't in any way less tested, you should always stick to the newest released JDK version, be it LTS or not, this way you get all the benefits (language features, performance gains) and security ones (security fixes always first land in the newest version, and are backported to the older ones). Upgrades now are pretty straightforward if you are past JKD 9 - with JDK 16-17…

》All other versions aren't in any way less tested Source?

OpenJDK serves as the upstream for many Java distributions (maybe all?) and it has no notion of LTS. LTS is just something to which vendors commit as outlined at https://openjdk.java.net/projects/jdk/17/ : “JDK 17 will be a long-term support (LTS) release from most vendors.”.

In other words, OpenJDK does not follow any LTS/non-LTS release cycle. Hence there is nothing special about Java 17 vs 16 when it comes to stability.

Re: Which version of JDK should I use?

#39
post #30
post #17

Earlier quoted context omitted.

Technically it's the Groovy runtime that doesn't support 17 (or specifically, JVM bytecode v62+) yet. And then only because it seems to do an explicit whitelisted-version check during some buildscript static-analysis bootstrap phase. If you switch your Gradle buildscript files over to being written in Kotlin, the problem goes away, as Kotlin's runtime doesn't seem to use any similar explicit checks. (Doing so also al…

It should also work with the latest versions of Gradle (7.2 or so), as the Groovy runtime used by Gradle has since been upgraded. https://github.com/gradle/gradle/issues/16857

Yes, it does now; but the Groovy runtime still has the general problem of not working with each new JVM version for months after it comes out. Whereas, with the Kotlin runtime, you can just forget about this problem and upgrade as soon as you like.

Re: Which version of JDK should I use?

#40
post #23

The general guidance is always use the last LTS release unless there is a specific feature in the non LTS releases that you can’t wait for. So any new development should target 17 at this point. Unless you want serious long term pain then you shouldn’t be more than one LTS release behind. So if you are not running on JDK 11 or later you should be strongly thinking about upgrading.

Why should I stick to LTS? All other versions aren't in any way less tested, you should always stick to the newest released JDK version, be it LTS or not, this way you get all the benefits (language features, performance gains) and security ones (security fixes always first land in the newest version, and are backported to the older ones). Upgrades now are pretty straightforward if you are past JKD 9 - with JDK 16-17…

In large installations I have almost always had problems, some little, some big with major version upgrades of Java.
Post reply on HN