Oracle announced the general availability of Java 16 on March 16, introducing new capabilities that improve the performance and usability of the widely deployed open-source programming language.
Java 16 is the first major release for Java in 2021; the last major update, Java 15, was launched in September 2020 and introduced new memory management and garbage collection capabilities. Implemented in Java 16 are a total of 17 major JDK Enhancement Proposals (JEPs), each introducing a new or updated feature.
Since 2017, Java has been on a six-month release cadence, with two updates a year. "Every six months, a new version of Java is released, and this happened like clockwork," Chad Arimura, vice president of developer relations at Oracle's Java Platform Group, told ITPro Today. "Java 16 is the seventh release as part of this cycle."
New Features in Java 16
In terms of which new feature in Java 16 will be the most impactful, that depends on the developer and what will make a difference in a particular workflow, Arimura said.
For those who care a lot about the language features, JEP 394 for Pattern Matching and JEP 395 for Records will be helpful, according to Arimura. JEP 394 and JEP 395 will enable developers to reduce the amount of boilerplate code used in Java, allowing them to more concisely express what they are trying to do in a program, he said.
Another capability that Arimura called out is JEP 376, titled ZGC: Concurrent Thread-Stack Processing, which builds on the garbage collection capabilities that Java 15 introduced.
"ZGC: Concurrent Thread-Stack Processing is the attempt at bringing ZGC garbage collecting from an average of 10 milliseconds down to below submillisecond times, which is a really big improvement in the performance of ZGC," he said.
Packaging Tool Comes to Java
Java 16 also includes updates for libraries and tools, a key one being JEP 392, as it introduced a new packaging tool for Java.
The way that Java applications have long been deployed is first a user would install a Java runtime and then deploy code on top. However, the Java deployment model is shifting toward a more App Store model, where the runtime is shipped alongside the code itself, Arimura said.
"What the packaging tool does is it takes the runtime, all the dependencies and the code, and builds a native executable to run on individual systems," he said.