TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Which version of JDK should I use?

329 pointsby aiobeover 3 years ago

36 comments

rococodeover 3 years ago
These recommendations are pretty arbitrary and don&#x27;t even attempt to scratch the surface of what is actually materially different between the JDKs. Don&#x27;t use Corretto outside of Amazon... why? Don&#x27;t use Dragonwell because... China bad? Use Red Hat OpenJDK if you&#x27;re running on Red Hat servers, Microsoft OpenJDK if you&#x27;re on Azure, SapMachine if you&#x27;re on SAP, because... the name matches so that&#x27;s nice? At least they&#x27;re consistent on that point. There are (generally pretty niche) reasons to pick specific distros, but those reasons certainly aren&#x27;t discussed here.<p>I feel like the actual decision process is fairly straightforward in nearly all cases:<p>- Use whatever vendor happens to be most convenient to install. If nearly everyone using your OS is installing Java one way, and you&#x27;re installing it some other unusual way, you should be crystal clear about why exactly you need to do that.<p>- Generally go with JDK 11, if you may have to deal with older software then maybe go with 8, if you want the shiny new stuff and don&#x27;t mind some extra hassle then go with JDK 17 (it&#x27;s not well-supported by everything yet).<p>That&#x27;s pretty much it. There are exceedingly few cases where it actually matters whether you installed Corretto or Oracle OpenJDK, and in those cases you&#x27;ll likely end up either testing all the JDKs anyway to make your decision or writing your own patches for whatever you need.
评论 #28822432 未加载
评论 #28826306 未加载
评论 #28825709 未加载
评论 #28824532 未加载
评论 #28825034 未加载
评论 #28825643 未加载
pronover 3 years ago
Here&#x27;s my recommendation (I work on OpenJDK at Oracle):<p>If you&#x27;re using the current JDK version (recommended for regularly maintained applications), it doesn&#x27;t matter which distribution you choose, as they&#x27;re all pretty much identical. If you&#x27;re using an old version (LTS, intended for legacy applications, which might benefit from it), pick a vendor you trust for OpenJDK support, as the builds are <i>not</i> the same, and neither is the support. After Oracle, which contributes about 90% of the work on OpenJDK, the companies distributing builds that contribute to the project and have experience with it are (in rough order of experience and&#x2F;or contribution): Red Hat, SAP, Azul, Bellsoft, and, more recently, Amazon, and Microsoft.<p>There are, however, a couple of standouts: Alibaba&#x27;s Dragonwell, which, last I looked, did not meet the Java specification, and Eclipse Adoptium, built by IBM, which is the only distribution built by a team that isn&#x27;t involved with the OpenJDK project, isn&#x27;t very familiar with it, and isn&#x27;t a member of the OpenJDK Vulnerability team, and so get security patches only after the other vendors have delivered their builds.
评论 #28821799 未加载
评论 #28821414 未加载
评论 #28827036 未加载
评论 #28821417 未加载
spiralpolitikover 3 years ago
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.<p>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.
评论 #28821539 未加载
评论 #28821037 未加载
评论 #28820994 未加载
评论 #28821185 未加载
Thev00d00over 3 years ago
What is this naming? Embarrassing levels of bad &quot;Adoptium Eclipse Temurin OpenJDK &quot;
评论 #28820836 未加载
ahmedfromtunisover 3 years ago
I wish there were a section like this one in every tools&#x27; home&#x2F;download page.<p>A section called &quot;For production use this&quot; or &quot;if you don&#x27;t know what you&#x27;re looking for, use this&quot;. And &quot;this&quot; can be a particular version (Ubuntu 20.04.6) or a rule of thumb (for production, always use x.y.1 version or above).<p>Or it can be a table like this one. Django is, as it is in many fields, the gold standard in this regard.<p>It gets confusing sometimes. Yesterday I was trying to update the python version of one of my applications and was wondering; should I do it now, or do I need to wait for 3.10.1? I did it anyway because the app barely gets traffic anyway, but more clarity is always welcome.
PaulKeebleover 3 years ago
It really is quite incredible what a mess has made of the clear stability of Java and what to get since Oracle took over.
评论 #28821106 未加载
评论 #28821247 未加载
评论 #28820945 未加载
twicover 3 years ago
I&#x27;d like to see more of a rationale for not using Corretto on non-AWS servers. What&#x27;s wrong with it?
评论 #28821536 未加载
评论 #28821977 未加载
评论 #28821199 未加载
评论 #28821036 未加载
评论 #28821363 未加载
评论 #28821129 未加载
评论 #28820887 未加载
评论 #28821586 未加载
chadrsover 3 years ago
Yeah I agree we should be using 17 except Gradle still does not support it, despite having been out for an entire month...<p><a href="https:&#x2F;&#x2F;docs.gradle.org&#x2F;current&#x2F;userguide&#x2F;compatibility.html" rel="nofollow">https:&#x2F;&#x2F;docs.gradle.org&#x2F;current&#x2F;userguide&#x2F;compatibility.html</a>
评论 #28820942 未加载
评论 #28820858 未加载
评论 #28820948 未加载
评论 #28821708 未加载
smarx007over 3 years ago
I think this advice only applies to the end users of the JDK and libs, e.g. people who develop webapps. We maintain an OSS library and plan to support JDK 8 for as long as possible (though some of our dependencies made a move to JDK 11 and most likely we&#x27;ll have to follow suit). With this approach, our libraries can be used by developers under JVM 8, 11, or 17.
评论 #28821659 未加载
miked85over 3 years ago
I&#x27;ve never heard of Adoptium Eclipse Temurin before. It looks like all releases were just within the last few months, but this is the recommendation? Seems a bit strange.
评论 #28821521 未加载
giordsover 3 years ago
IMHO this mess will hurt Java on the medium-long run.<p>All of this is unnecessarily complicated and confusing, as a developer it really feels like they don&#x27;t want me to use Java.<p>I have the feeling that, similarly to what happened with the Roman empire, greed, laziness and burocracy are going to drag everything down.
评论 #28825813 未加载
zh3over 3 years ago
For those of us supporting more than a few legacy apps, use the oldest version (7 in our case) because then there&#x27;s less chance of things going wrong (depends, of course, whether you bill per support call or a fixed annual fee).
评论 #28820877 未加载
nlitenedover 3 years ago
Is there a way to apt-get the new JDK 17 as a package on Ubuntu, instead of piping a shell script from curl or unzipping a tar? Does anybody use package managers on Linux anymore?
评论 #28825499 未加载
评论 #28821961 未加载
评论 #28821905 未加载
ypcxover 3 years ago
Use Openj9 to lower your RAM requirements. Use HotSpot for compatibility with tools like heap&#x2F;thread dumpers and I guess profilers&#x2F;debuggers.
thayneover 3 years ago
How do the versions in linux package repositories fit into this? It mentions Red Hat, but what about the packages for Debian&#x2F;Ubuntu, OpenSUSE, etc.
dudulover 3 years ago
Minor typo in the FAQ: &quot;The JRE is a stripped down version of the JRE, and is smaller in terms of Megabytes.&quot;
armchairhackerover 3 years ago
I was literally just looking at JDK comparisons out of interest (I already have my app running under a JDK). But I&#x27;m still not convinced which is the &quot;best&quot; one.<p>What are some difference between OpenJDK, Adoptium, Azul, BellSoft, etc. besides company dependencies and lifecycle? Which JDK is the fastest, or do certain JDKs perform faster under certain scenarios? Do any of these JDKs have any special features, or can they not do certain advanced reflection (e.g. for efficiency?)<p>I use IntelliJ so switching JDK is very easy, and most apps work on any JDK. Plus I doubt anything I release would be relevant in the long term (at least without the ability to upgrade JDK). So I really don&#x27;t have to depend on any JDK, and seems like I don&#x27;t have to worry about my JDK getting obsolete. Is there still a reason why I would prefer to use one JDK over another?
评论 #28824605 未加载
miked85over 3 years ago
I find some of these recommendations confusing, there doesn&#x27;t seem to be reasons to back them.<p>For example: &gt; <i>Use Corretto, only if you run Java applications directly on Amazon Linux 2 in AWS</i><p>Why?
094459over 3 years ago
Thanks for crafting this document, it’s a great start and good to get the discussions started. For me, when I look at which distribution to use I would probably consider other factors that this post doesn’t touch upon completely. What sort of upstream contributions and activity, support across both cloud and on premise and multi architecture support are just a few that come to mind.
karmakazeover 3 years ago
This page should definitely have a &quot;end of free public updates&quot; column as is shown on the &quot;Java version history&quot;[0] page, so it&#x27;s clear updates stop much sooner than the LTS.<p>[0] <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Java_version_history" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Java_version_history</a>
Decabytesover 3 years ago
I’ve tried more than once to learn Java I find it very confusing. This website resolves one of the issues. The other issue I have is that most Java tutorials use IntelliJ, or some other IDE, which makes it difficult to figure out what a non IDE workflow actually looks like, some managing dependencies is confusing.<p>I wonder if c# and mono is better in this respect
评论 #28821957 未加载
评论 #28821623 未加载
评论 #28826266 未加载
评论 #28821506 未加载
评论 #28821500 未加载
评论 #28821508 未加载
评论 #28824686 未加载
iamcreasyover 3 years ago
Why its recommends against using OpenJDK builds by Oracle? Does it come with the same licensing restriction as Oracle JDK?
评论 #28820851 未加载
评论 #28820974 未加载
hiram112over 3 years ago
Thank you for this.<p>I&#x27;ve seen, over the past few years, at least a dozen large threads on HN, Reddit, Slashdot, and elsewhere arguing over the JDK.<p>Usually they&#x27;re a passionate mix of developers and PMs claiming they&#x27;re still very confused by the licensing and update &#x2F; security fix terms since JDK 8, while various Oracle engineers then shout back that the licensing issues are straight forward.<p>Personally, I&#x27;ve developed with Java for over a decade, and I have never really understood when I should use one version or the other. Oracle, Eclipse Foundation, IBM, and the other big players have not done a good job of marketing the various offerings, nor have they done a good job of clarifying for engineers what they should be installing on their local machines, development and test servers, production, etc.<p>This is probably the clearest fact sheet I&#x27;ve seen yet, and the links to different distributions with a concise &quot;Use &#x2F; Don&#x27;t Use...&quot; rating is indispensable.
评论 #28821812 未加载
modelessover 3 years ago
What a great site! I have often wondered about these things but I&#x27;m not a Java guy so I never investigated for myself. I&#x27;ve never heard of Adoptium before but it sounds like the right choice.
agilobover 3 years ago
Highlights column only includes syntax sugar or syntactical functionality, but nothing about ZGC, shenandoah, compact metaspace? Very unfair.
sireatover 3 years ago
So for those running Scala in production, which version do you use?<p>I am still seeing a lot of projects on 8.<p>New Scala projects are generally on Corretto 11.
评论 #28824701 未加载
评论 #28826222 未加载
irq-1over 3 years ago
Now do .NET :)<p>No, seriously, we need the same thing for .NET
shp0ngleover 3 years ago
&quot;Adoptium Eclipse Temurin&quot;<p>....ok
jaimex2over 3 years ago
Something went terribly wrong after Java 8.<p>A lot of apps just got stuck there.
vbezhenarover 3 years ago
Use Oracle JDK 17.
WalterSobchakover 3 years ago
I wonder why this site doesn&#x27;t enforce HTTPS, which it clearly supports.<p><a href="https:&#x2F;&#x2F;whichjdk.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;whichjdk.com&#x2F;</a>
评论 #28821176 未加载
bombcarover 3 years ago
No mention of GraalVM - <a href="https:&#x2F;&#x2F;www.graalvm.org" rel="nofollow">https:&#x2F;&#x2F;www.graalvm.org</a> - perhaps because it&#x27;s Oracle?
评论 #28826315 未加载
underscore_kuover 3 years ago
java --version<p>openjdk 11.0.11 2021-04-20<p>OpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2)<p>OpenJDK 64-Bit Server VM (build 11.0.11+9-Ubuntu-0ubuntu2, mixed mode, sharing)
lbayesover 3 years ago
(deleted stupid comment) apologies!
评论 #28827028 未加载
kburmanover 3 years ago
Who would anyone be using Chinese SDK? Recent Mi phone revelation are not enough?
评论 #28826401 未加载
评论 #28826220 未加载
ryanmarshover 3 years ago
What a zoo. So glad I’m not trying to deploy Java workloads anymore. It used to be the best JVM was the Sun JVM and everyone used it.