It's Time to Move Over to Java 17

Java 17: What’s New?

It is always a good idea to upgrade to the latest LTS (Long Term Support) release of any coding language or software. A new version of Java is released twice a year, so what’s so special about Java 17? In this article we will identify the differences between Java 17 and Java 8, the most important upgrades in Java 17, and the implications of updating to Java 17.

Java-17

A Bit of History

java history
 

Java 8 was released March 2014 and included Lambdas, streams, functional programming, and extensive API extensions. This was an exciting time for Java developers, who hadn’t had a Java update in 3 years. After Java 8’s release, Oracle began updating Java with new releases quite frequently, producing 8 more versions of Java within 7 years, with the pace quickening as time went on. Currently, a new version of Java is released every six months, which makes it tempting to overlook Java 17 as just another update.

Here’s an overview of the updates made in versions 9-16, before we discuss the major changes Java 17 has to offer.

Java 9 was a pretty big release, adding a couple of additions and methods to collections, streams, optionals, and interfaces. In this version, Java also got Jshell, HTTPClient, and Project Jigsaw.

Java 10 primarily introduced local-variable type inference which replaces the “String” keyword with our much more up-to-date “var” Java 11 was the last LTS release of Java, but from a development perspective, it was a fairly small release. This version introduced changes to strings & files, a smoother running of source files, var for lambda parameters, and a number of other small changes.

Java 12 primarily introduced Unicode 11 support.

Java 13 gave us a couple of improved preview features that have all since been changed.

Java 14 made switch expressions, previously previewed, standard expressions. This version offered us record classes to reduce boilerplate Java, descriptive NullPointerExceptions, and an incubating jpackage tool.

Java 15 finalized multiline strings, and the new Z Garbage collector.

Java 16 provided us with pattern matching for instanceof, unix-domain socket channels, and records and pattern matching.

So, What are the Differences Between Java 8 and Java 17?

Java 17 features context-specific deserialization filters for added security and includes all of the additional features Java received since the Java 11 release. Java 17 also includes a preview of pattern matching for switch statements.

Recalling the changes in Java over the past 8 years, there have been very few finalizations of features from one version to the next. The biggest differences have come in the form of previews of features soon to become finalized by Oracle.

The most major difference between Java 8 and Java 17 is that Java 17 has overtaken Java 8’s place as the long term support version of Java. Java 17 will be Oracle’s LTS until at least September 2026. If you haven’t already, the sooner you update to this new LTS version, the better. Don’t waste your time creating Java 8 code that is already outdated and needing to be migrated to Java 17.

java 17

Update:

As of March 2022, Oracle no longer supports Java 8. This version may receive an update here or there,  but generally it won’t be maintained given Oracle’s effort to support the new Java 17. Java 17 compiles the major achievements of Java’s development over the last decade or so. There’s really no purpose in delaying the switch. With so many versions of Java, Oracle isn’t entirely forgetting their less up-to-date users, but has chosen this time to wrap up and finalize the best features through the years and venture forward to prioritize their Java versions of the future. Overall, the switch to Java 17 gives developers an opportunity to use the latest and greatest techniques and improve their code base.

Dharmendar Sriramoju