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.

Spring Boot and Java 16 Records

On March 16th, 2021, Java 16 was GA. With this new release, tons of new exciting features have been added. Check out the release notes to know more about these changes in detail. This article's focus will be on Java Records, which got delivered with JEP 395. Records were first introduced in JDK 14 as a preview feature proposed by JEP 359, and with JDK 15, they remained in preview with JEP 384. However, with JDK 16, Records are no longer in preview.

I have picked Records because they are definitely the most favored feature added in Java 16, according to this Twitter poll by Java Champion Mala Gupta.

jpackage Is Production-Ready in Java 16

If you shudder thinking about compilation for different platforms, I know the feeling. One of the Java promises, the WORA (Write Once, Run Anywhere) principle, while revolutionizing platform independence, it stopped short of one more step – to be able to deploy anywhere. Personally, I think that WORADA sounds awesome, but I guess before Docker it didn’t occur to people that eliminating “works on my machine” is as simple as shipping your machine.

So you wrote a class, you’ve built a jar file and then you needed the right JVM (or JDK) and all the right dependencies, organized in a very particular way in order to make it work. What are the chances this knowledge will be consistently transferred intact from the Dev silo to the Ops silo?