- Developers can use the new Packaging Tool (JEP 392) to ship self-contained Java applications and explore three incubating features
- These are the Vector API (JEP 338), the Foreign Linker API (JEP 389), and the Foreign-Memory Access API (JEP 389), and one preview feature, Sealed Classes (JEP 397)
Oracle has announced the availability of Java 16 (Oracle JDK 16), including 17 new enhancements to the platform that will further improve developer productivity. The latest Java Development Kit (JDK) finalized Pattern Matching for instanceof (JEP 394) and Records (JEP 395), language enhancements that were first previewed in Java 14. Developers can use the new Packaging Tool (JEP 392) to ship self-contained Java applications and explore three incubating features.
These are the Vector API (JEP 338), the Foreign Linker API (JEP 389), and the Foreign-Memory Access API (JEP 389), and one preview feature, Sealed Classes (JEP 397). Oracle delivers Java updates every six months to provide developers with a predictable release schedule. It said that this offers a steady stream of innovations while also delivering continued performance, stability and security improvements, increasing Java’s pervasiveness across organizations and industries of all sizes.
Georges Saab, vice president of development, Java Platform Group, Oracle said, “The power of the six-month release cadence was on full display with the latest release. Pattern Matching and Records were introduced a year ago as part of JDK 14 and have since gone through multiple rounds of community feedback based on real-world applications. This process has not only given Java developers the opportunity to experiment with these features before they were finalized, but also incorporated that critical feedback which has resulted in two rock-solid JEPs that truly meet the needs of the community.”
The new features delivered in Java 16 are Language Enhancements First Introduced in JDK 14, Finalised in JDK 16. JEP 394: Pattern Matching for instance of – Enhances the Java programming language with pattern matching for the instance of operator. The JEP 395: Records enhances the Java programming language with records, which are classes that act as transparent carriers for immutable data. Records can be thought of as nominal tuples.
JEP 392: Packaging Tool provides the jpackage tool, for packaging self-contained Java applications. The JEP 387: Elastic Metaspace returns unused HotSpot class-metadata (i.e., metaspace) memory to the operating system more promptly, reduces metaspace footprint, and simplifies the metaspace code in order to reduce maintenance costs. The JEP 376: ZGC: Concurrent Thread-Stack Processing moves ZGC thread-stack processing from safepoints to a concurrent phase. This work eliminates the last significant bottleneck for allowing concurrent stack processing.
End users can still choose the relaxed strong encapsulation that has been the default since JDK 9
The JEP 380: UNIX-Domain Socket Channels adds support for all of the features of UNIX-domain sockets that are common across the major UNIX platforms and Windows to the socket channel and server-socket channel APIs in the java.nio.channels package. UNIX-domain sockets are used for inter-process communication (IPC) on the same host. They are similar to TCP/IP sockets in most respects, except they are addressed by filesystem path names rather than Internet Protocol (IP) addresses and port numbers.
The JEP 396: Strongly Encapsulate JDK Internals by Default – In JDK 9 we strongly encapsulated new internal API elements, thereby limiting access to them.
It added, “As an aid to migration, however, JDK 9 deliberately chose not to strongly encapsulate at run time the content of packages that existed in JDK 8. JDK 16 tightens this constraint by encapsulating most internal elements of the JDK by default, except for critical internal APIs such as sun.misc.Unsafe. End users can still choose the relaxed strong encapsulation that has been the default since JDK 9. This will encourage developers to migrate from using internal elements to using standard APIs, so that both they and their users can upgrade without fuss to future Java releases.”
JEP 390: Warnings for Value-Based Classes, designates the primitive wrapper classes as value-based and deprecate their constructors for removal, prompting new deprecation warnings. Provides warnings about improper attempts to synchronize on instances of any value-based classes in the Java Platform.
The JEP 338: Vector API (Incubator) provides an initial iteration of an incubator module, jdk.incubator.vector, to express vector computations that reliably compile at runtime to optimal vector hardware instructions on supported CPU architectures. The JEP 389: Foreign Linker API (Incubator) introduces an API that offers statically-typed, pure-Java access to native code.
The JEP 393: Foreign-Memory Access API (Third Incubator) introduces an API to allow Java programs to safely and efficiently access foreign memory outside of the Java heap.The JEP 397: Sealed Classes (Second Preview) enhances the Java programming language with sealed classes and interfaces. Sealed classes and interfaces restrict which other classes or interfaces may extend or implement them.
The JEP 347: Enable C++14 Language Features (in the JDK source code) allows the use of C++14 language features in JDK C++ source code, and gives specific guidance about which of those features may be used in HotSpot code.The JEP 357: Migrate from Mercurial to Git – Migrates the OpenJDK Community’s source code repositories from Mercurial (hg) to Git. The JEP 369: Migrate to GitHub hosts the OpenJDK Community’s Git repositories on GitHub.
The JEP 386: Alpine Linux Port ports the JDK to Alpine Linux, and to other Linux distributions that use musl as their primary C library, on both the x64 and AArch64 architectures. The JEP 388: Windows/Aarch64 Port ports the JDK to Windows/AArch64.