{"id":1235,"date":"2020-07-20T21:07:06","date_gmt":"2020-07-20T20:07:06","guid":{"rendered":"http:\/\/hirt.se\/blog\/?p=1235"},"modified":"2020-07-21T14:07:06","modified_gmt":"2020-07-21T13:07:06","slug":"fantastic-jvms-and-where-to-find-them","status":"publish","type":"post","link":"https:\/\/hirt.se\/blog\/?p=1235","title":{"rendered":"Fantastic JVMs and Where to Find Them"},"content":{"rendered":"<p>Since you\u2019re reading this blog, chances are that you\u2019re writing software which will eventually run on a JVM. Most of you are using the Java language. Many of you are using a variety of other languages that target the JVM, such as Scala, Kotlin, Clojure, Groovy, (J)Ruby etc. Eventually you\u2019ll need to decide on which JDK\/JRE to deploy your software on in production. This is much easier said than done. There are quite a few different vendors out there, providing support and taking responsibility for the binaries they produce. They can have different support lengths for specific versions, and whereas you can sometimes find a vendor providing extended support for a version that has been officially end-of-lifed at Oracle, you may not find builds with the latest fixes in them publicly available. You\u2019ll need to get those directly from the vendor.<\/p>\n<p>After trying to figure out what\u2019s what, I thought I\u2019d simply write a blog post on the various JDKs available out there. This is especially important, since you might be consuming your JDK from a container provided by a third party, e.g. Docker Hub, and you may not know exactly what you\u2019re getting[1].<\/p>\n<h2>Release Version Chicken Race<\/h2>\n<p>Typically most companies will require that you keep your dependencies up-to-date. For example, if you\u2019ve written something with a dependency on Tomcat, you are pretty likely to keep your dependencies up-to-date. GitHub may even warn you if you\u2019re running with a version that has known security implications. However, not everyone is keeping their JDKs\/JVMs up-to-date. Which is funny, in a way, since everything you\u2019ll be running could be affected.<\/p>\n<p>Let\u2019s take the Oracle JDK as an example. JDK 7 was GA in July 2011. Publicly available updates and fixes ceased in April 2015. Oracle\u2019s Premier Support ended in July 2019, and even the Extended Support ends 2022.<\/p>\n<p>Let\u2019s say you\u2019re running on JDK 7. If you got your JDKs from Oracle, without a support contract chances are that the latest version of JDK 7 you got was built in 2015. You are now five (5!) years behind on critical security patches.<\/p>\n<p>In other words, if you\u2019re still running your software on JDK 7, you may want to at least begin upgrading to 8. JDK 7 is dying and support is being dropped left and right. If you aren\u2019t buying support and have someone provide you with (security) patches, you might want to accelerate the effort. Also, this particular upgrade (7-&gt;8) should be relatively painless \u2013 in most cases it will be a drop in replacement. Now, if you\u2019re not running a JDK 7 with the latest patches (sanity check \u2013 was the JDK at least built this year?), you may not only be missing out on bug fixes, but you may also be missing out on <a href=\"https:\/\/www.cvedetails.com\/version-list\/93\/19116\/1\/Oracle-JDK.html?sha=b856721542b66953c859bd95be067255dd4c6098&amp;order=1&amp;trc=188\">security patches<\/a>[2]!<\/p>\n<p>The same arguments could be made for JDK 8 as well, on a slightly pushed out time-line. The good news is that there are still public (and free) updates coming from the OpenJDK 8 maintenance project. That said, there are plenty of advantages for upgrading to JDK 11+, better performance being one of them.<\/p>\n<p>Now, when the new, faster, release schedule was announced, Oracle announced that every 3 years, there would be an LTS (Long Term Support) version of Java. The releases in between the LTS releases would only be supported until the next release came out. Most vendors have adopted the same support scheme, which means that, at the time of writing, you should not be running ANYTHING on JDK 9,10,12 and 13 (unless you\u2019re using Azul distributions, see [3]). They are not supported. Running them will only mean that you are lacking bug- and security fixes. To take a somewhat arbitrary example &#8211; if you stopped upgrading JDK 8 after 8u74, you are literally lacking <a href=\"https:\/\/bugs.openjdk.java.net\/secure\/Dashboard.jspa?selectPageId=19531\">thousands of fixes<\/a>.<\/p>\n<p>At the time of writing this blog, the new CPU (Critical Patch Update) releases have just been published, and these are the releases you should be running in July 2020 (sooner rather than later):<\/p>\n<ul>\n<li>JDK 8u262<\/li>\n<li>JDK 11.0.8<\/li>\n<li>JDK 13.0.4 [3]<\/li>\n<li>JDK 14.0.2<\/li>\n<\/ul>\n<p>If you\u2019re running anything else in production, without a support contract, it could be argued you\u2019re not doing things quite right.<\/p>\n<h2>What\u2019s what?<\/h2>\n<p>OpenJDK, being open sourced, has builds provided by plenty of vendors. Here is a<strong> non-exhaustive<\/strong> list of some vendors shipping supported versions of OpenJDK (in alphabetical order, distribution(s) in parenthesis):<\/p>\n<ul>\n<li><a href=\"https:\/\/adoptopenjdk.net\/\">AdoptOpenJDK <\/a><\/li>\n<li><a href=\"https:\/\/github.com\/alibaba\/dragonwell8\">Alibaba<\/a> (Dragonwell)<\/li>\n<li><a href=\"https:\/\/aws.amazon.com\/corretto\/\">Amazon <\/a>(Corretto)<\/li>\n<li><a href=\"https:\/\/www.azul.com\/downloads\/zulu-community\/?architecture=x86-64-bit&amp;package=jdk\">Azul<\/a> (Zulu, Zing)<\/li>\n<li><a href=\"https:\/\/bell-sw.com\/pages\/downloads\/\">BellSoft <\/a>(Liberica)<\/li>\n<li><a href=\"https:\/\/access.redhat.com\/articles\/1299013\">Red Hat<\/a> (Red Hat Builds of OpenJDK)<\/li>\n<li><a href=\"http:\/\/java.oracle.com\/\">Oracle<\/a> (Oracle JDK, Oracle OpenJDK)<\/li>\n<li><a href=\"https:\/\/sap.github.io\/SapMachine\/\">SAP<\/a> (SapMachine)<\/li>\n<\/ul>\n<p>These providers usually ship distributions with pretty much the same bits from the OpenJDK repository, sometimes differing by what features are enabled, for example like a GC (Shenandoah \/ Red Hat), or by adding proprietary features like a new compiler (Falcon \/ Azul (Zing)). Some vendors have a free distribution (e.g. Oracle OpenJDK, Azul Zulu) and one that requires a commercial license (Oracle JDK, Azul Zing). Which vendor and distribution you should select depends on your demands \u2013 e.g. which vendor can provide reliable support to you (Oracle is one of the biggest contributors to OpenJDK), or which one provides the feature you need at a price point you can afford (e.g. JDK Flight Recorder on JDK 8 without the need for a commercial license, or support for a specific GC or compiler).<\/p>\n<p>There are also upstream builds, not supported by anyone, built on Red Hat infrastructure and hosted by AdoptOpenJDK. For example, if you get a JDK 8 from Docker Hub (openjdk\/jdk8u252, openjdk\/jdk8), that is what you would <a href=\"https:\/\/github.com\/docker-library\/openjdk\/blob\/master\/8\/jdk\/Dockerfile\">get<\/a>.<\/p>\n<h2>Where to get JFR &#8211; Public Service Announcement<\/h2>\n<p>As you probably know, JDK Flight Recorder, a technology close to my heart, has been backported to JDK 8. Since we\u2019re talking about where to get your JVMs and versions, I thought I\u2019d include a small table for which provider will be including JFR in what version of their JDK 8 builds.<\/p>\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\">\n<tbody>\n<tr>\n<th valign=\"top\">Vendor<\/th>\n<th valign=\"top\">First JDK 8 Version with JFR<\/th>\n<th valign=\"top\">Release Date<\/th>\n<th valign=\"top\">Docker Image<\/th>\n<\/tr>\n<tr>\n<td valign=\"top\"><a href=\"https:\/\/www.azul.com\/downloads\/zulu-community\/?architecture=x86-64-bit&amp;package=jdk\">Azul (Zulu)<\/a><\/td>\n<td valign=\"top\">u212* (u262+ recommended)<\/td>\n<td valign=\"top\">2019-04-16<\/td>\n<td valign=\"top\">azul\/zulu-openjdk\/8<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\"><a href=\"https:\/\/adoptopenjdk.net\/releases.html?variant=openjdk8&amp;jvmVariant=hotspot\">AdoptOpenJDK<\/a><\/td>\n<td valign=\"top\">u262<\/td>\n<td valign=\"top\">2020-07-16<\/td>\n<td valign=\"top\">adoptopenjdk\/8u262<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">Red Hat<\/td>\n<td valign=\"top\">u262<\/td>\n<td valign=\"top\">2020-07-15<\/td>\n<td valign=\"top\">In Fedora and RHEL<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\"><a href=\"https:\/\/github.com\/corretto\/corretto-8\/releases\">Amazon (Corretto)<\/a><\/td>\n<td valign=\"top\">u262<\/td>\n<td valign=\"top\">2020-07-14<\/td>\n<td valign=\"top\">amazoncorretto:8u262<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\"><a href=\"https:\/\/bell-sw.com\/announcements\/2020\/07\/14\/The-Liberica-8u262-11_0_8-14_0_2-are-generally-available\/\">Bell-Soft (Liberica)<\/a><\/td>\n<td valign=\"top\">u262 (separate binary)<\/td>\n<td valign=\"top\">2020-07-14<\/td>\n<td valign=\"top\">N\/A<\/td>\n<\/tr>\n<tr>\n<td valign=\"top\">Upstream builds [4]<\/td>\n<td valign=\"top\">u272<\/td>\n<td valign=\"top\"><a href=\"https:\/\/www.oracle.com\/security-alerts\/\">2020-10-20<\/a><\/td>\n<td valign=\"top\">openjdk\/jdk8u272, openjdk\/jdk8<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Summary<\/h2>\n<ul>\n<li>Use the latest version of an LTS which is still supported, or the latest version<\/li>\n<li>Use a supported build in production (even if you haven\u2019t bought support)<\/li>\n<\/ul>\n<p>Thanks to Mario Torre, JP Bempel and Gil Tene for feedback!<\/p>\n<p>[1]: Mystery meat OpenJDK builds strike again: https:\/\/mail.openjdk.java.net\/pipermail\/jdk8u-dev\/2019-May\/009330.html<\/p>\n<p>[2]: To check the vulnerabilities you may be exposed to, see e.g. <a href=\"https:\/\/www.cvedetails.com\/version-list\/93\/19116\/1\/Oracle-JDK.html?sha=b856721542b66953c859bd95be067255dd4c6098&amp;order=1&amp;trc=188\">https:\/\/www.cvedetails.com\/version-list\/93\/19116\/1\/Oracle-JDK.html?sha=b856721542b66953c859bd95be067255dd4c6098&amp;order=1&amp;trc=188<\/a><\/p>\n<p>[3]: Upstream JDK 13u is being supported, and Azul has announced 13 to be \u201cMedium Term\u201c supported &#8211; you can keep getting updates for JDK 13 for Azul distributions.<\/p>\n<p>[4]: These are built by Red Hat and hosted by AdoptOpenJDK, and are different from Red Hat\u2019s and AdoptOpenJDK\u2019s supported builds.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Since you\u2019re reading this blog, chances are that you\u2019re writing software which will eventually run on a JVM. Most of you are using the Java language. Many of you are using a variety of other languages that target the JVM, such as Scala, Kotlin, Clojure, Groovy, (J)Ruby etc. Eventually you\u2019ll need to decide on which [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[12,36,37],"class_list":["post-1235","post","type-post","status-publish","format-standard","hentry","category-java-mission-control-fair-dj","tag-java","tag-jdk","tag-jvm"],"_links":{"self":[{"href":"https:\/\/hirt.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1235","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hirt.se\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hirt.se\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hirt.se\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/hirt.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1235"}],"version-history":[{"count":3,"href":"https:\/\/hirt.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1235\/revisions"}],"predecessor-version":[{"id":1238,"href":"https:\/\/hirt.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/1235\/revisions\/1238"}],"wp:attachment":[{"href":"https:\/\/hirt.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1235"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hirt.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1235"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hirt.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1235"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}