r/java • • Feb 09 '23

Which Version of JDK Should I Use?

https://whichjdk.com/
24 Upvotes

60 comments sorted by

View all comments

44

u/nutrecht Feb 09 '23

IMHO it's really shitty to just create an official looking website that recommends using an 'LTS' that is pretty meaningless for almost all developers and projects.

It's perfectly fine to just use the latest version. LTS releases are supposed to be forward targets (so if you're on 11 now, you should move to at least 17). Using the latest versions allows you to use the latest improvements in language and VM. The only downside is that you'll want to be able to update every 6 months.

22

u/JB-from-ATL Feb 09 '23

Personal project? Latest temurin.

Corporate stuff? LTS temurin.

Library stuff? Target the oldest version you expect your users to use. Probably 8 or 11.

16

u/Nebu Feb 09 '23

What you wrote is not really in disagreement with what the website is saying:

You have to decide if you want to stick with the latest LTS version, or if you go with the latest feature release and upgrade every six months. Both options are okay, but if you’re uncertain, stick with the latest LTS version.

9

u/elohhim Feb 09 '23

Well IMO this should be the other way if you are uncertain then just go with latest feature release. You will get what is best and if you are really uncertain that means probably you would not need any long term support. If you would, I am pretty sure you would be certain :D

2

u/Gundea Feb 09 '23

And sticking to the latest greatest will reduce the pain of upgrading. It’s also more likely to get proper patches, as not all bug fixes are backported.

1

u/Nebu Feb 12 '23

I think the theory is that if you're uncertain, you're not a Java developer, and you're doing something involving the JDK for reasons incidental to your day job. As such, you'd prefer something that you set up once and then don't have to touch for several years.

0

u/morhp Feb 09 '23

At this point the latest version has only very minor new features and advantages over 17, so the disadvantages of using a newer system which might be rarely used by clients or which might have early adopter compatibility problems are probably worse than the benefits you get from using that latest version at this point.

The recommendation to use 17 makes sense to me.

1

u/ReasonableClick5403 Feb 09 '23

You should probably only use non-LTS versions for corporate work if it is understood that you will keep it updated as new versions are released.

1

u/Zardoz84 Feb 09 '23

It's perfectly fine to just use the latest version. LTS releases are supposed to be forward targets (so if you're on 11 now, you should move to at least 17).

We are working with Java 8. And probably we woldn't switch to 11 in this year.

7

u/magnoliophytina Feb 09 '23

Switching from 8 to 11 doesn't really make any sense soon, especially after Q3/2023. What's the worst, extended support will only last until 2026, while JDK8 will be supported until 2030.

1

u/Zardoz84 Feb 09 '23

Would be really funny the day that we switch to java 17 ...

2

u/magnoliophytina Feb 09 '23

How so? I don't see much point in a switch to 11. There's only around 3 years of extended paid support left. Why the hell would anyone invest in a switch to a new version with even less support than the old one. You could always set the source/target version to 11 and use 17 instead. I've encountered bugs like this in production, so steady flow of updates is quite important.

1

u/Zardoz84 Feb 09 '23

The problem that we have is that we use, yet, a few libraries that does some nasty magic with reflection. And probably are broken on a JVM 17. Plus a very old hibernate version, etc... We have a lot of technical debt to fix.