How to Manage Your JDKs With SDKMAN

In this blog, you will learn how to manage several Java Development Kits (JDKs) on your Linux system using SDKMAN. Besides JDKs, several other SDKs can be managed by means of SDKMAN. Enjoy!

1. Introduction

Some time ago, a colleague of mine showed me how he used SDKMAN and how easy he could maintain different versions of JDKs, Maven, etc. on his Linux system. I had heard of SDKMAN before but did not yet take the time to take a closer look at it. But now I did :-).

Java 17 for the Impatient

I have been working on Java 8 for a long time and, now, Java 17 has been released, so let's have a quick look at this article which focuses on the latest Java 17 LTS features. 

There are lots of features and improvements that have been introduced, however, in this article, we will focus on a limited set:

Java: Migrating From Java 8 to Java 17

This article focuses on the features to use when moving directly from Java 8 to Java 17. If your application is still running on Java 8 in production, then It’s difficult to track the features developed after version 8 onwards but there are quite a few easy to use and extremely important features available which can be learned and implemented quickly when migrating from directly Java 8 to Java 17. 

In this article I will try to highlight some of them, I will also try to highlight the versions on which the specific feature is available for us to use but not necessarily in the sequential order of release.

JDK 18: What to Expect in Java 18

Anticipated to be launched in March 2022, Java 18 has attracted propositions for the hatching of the vector API. Also, it includes surveying the system complementing for redirecting statements and embracing UTF-8 as the default set of characters.   

The final production stages will be on December 9, 2021, and January 20, 2022. After that, the JDK 18 will be accessible to the audience from March 22, 2022. The disclosure of contenders is expected on February 10 and February 24, 2022.

Java 17 Features and Migration Considerations

A few months from now in March 2022, Java 8 will lose its Oracle Premier Support. It doesn’t mean that it won’t receive any new updates, but Oracle’s effort put into maintaining it will likely be significantly smaller than it is right now.

That means there’ll be a good reason to make the move to a new version, especially since on September 14th, 2021, Java 17 was released. This is the new Long Term Support version, with Oracle Premier Support to last until September 2026 (at least). What does Java 17 bring? How difficult will the migration be? Is it worth it? I’ll try to answer those questions in this article.

What’s New Between Java 11 and Java 17?

The 14th of September Java 17 was released. Time to take a closer look at the changes since the last LTS release, which is Java 11. A short introduction is given about the licensing model and after that, some of the changes between Java 11 and Java 17 are highlighted, mainly by means of examples. Enjoy!

1. Introduction

First, let’s take a close look at the Java licensing and support model. Java 17 is an LTS (Long Term Support) version just like Java 11. With Java 11 a new release cadence started. Java 11 came with support up to September 2023 and with an extended support up to September 2026. Also, with Java 11, the Oracle JDK was not free anymore for production and commercial use. Every 6 months a new Java version is released, the so-called non-LTS releases Java 12 up to and including Java 16. These are, however, production-ready releases. The only difference with an LTS release is that the support ends when the next version is released. E.g. the support of Java 12 ends when Java 13 is released. You are more or less obliged to upgrade to Java 13 when you want to keep support. This can cause some issues when some of your dependencies are not yet ready for Java 13. Most of the time, for production-use, companies will wait for the LTS releases. But even then, some companies are reluctant for upgrading. A recent survey of Snyk showed that only 60% is using Java 11 in production and this is 3 years after Java 11 was released! Java 8 is also still being used by 60% of the companies. Another interesting thing to notice is that the next LTS release will be Java 21 which will be released in 2 years. A nice overview whether libraries have issues or not with Java 17, can be found here.

JDK 17: Hexadecimal Formatting and Parsing

Build 3 of JDK 17 Early Access Builds includes the implementation for JDK-8251989 ("Hex formatting and parsing utility"). This newly introduced functionality for parsing and formatting hexadecimal values is encapsulated in the new class java.util.HexFormat and is the subject of this post.

Running javap against the new java.util.HexFormat class provides an easy way to see an overview of its API. The following output is generated from running javap java.util.HexFormat: