Java 13 Goes GA
- By John K. Waters
Oracle this week announced the general availability of the Java Standard Edition 13 Platform (Java SE 13) and its open source reference implementation, the Java Development Kit 13 (JDK 13), at its annual Oracle OpenWorld conference in San Francisco.
Oracle's Java Language Architect, Brian Goetz, highlighted the new features in this release during his Code One Community Keynote. "This is a great time for Java, he said. "We're delivering faster, there are useful features in every version, and the pipeline for the future is better than it's ever been."
Goetz's list of top Java Enhancement Proposals (JEPs) included or previewed in this release included:
- Dynamic CDS Archives (JEP 350):
Introduced in JDK 5, class-data sharing (CDS) allows a set of classes to be pre-processed into a shared archive file that can be memory-mapped at runtime to reduce startup time. It can also reduce dynamic memory footprint when multiple JVMs share the same archive file. This feature extends application class-data sharing to allow the dynamic archiving of classes at the end of Java application execution. The archived classes will include all loaded application classes and library classes that are not present in the default, base-layer CDS archive.
- ZGC: Uncommit Unused Memory (JEP 351):
This JEP will enable the Z Garbage Collector (ZGC) to return unused heap memory to the operating system. Other GCs in HotSpot, such as G1 and Shenandoah, already provide this capability. But it's increasingly needed in things like container environments, where resources are paid by use; environments where an application might be idle for long periods of time and is sharing or competing for resources with many other applications; and among apps that have very different heap space requirements during its execution.
- Reimplement the Legacy Socket API (JEP 353):
This JEP replaces the underlying implementation used by the java.net.Socket and java.net.ServerSocket APIs with a simpler and more modern implementation that is easy to maintain and debug. The new implementation is designed to be easy to adapt to work with user-mode threads, a.k.a. fibers, currently being explored in Project Loom.
- Switch Expressions (Preview) (JEP 354):
This preview language feature, which extends the switch statement so that it can be used as a statement or an expression, and both forms can use a "traditional" or "simplified" scoping and control flow behavior, was originally proposed in 2017 and offered as a preview feature in Java 12 (JEP 325). This JEP makes one change: to yield a value from a switch expression, the break with value statement is dropped in favor of a yield statement.
- Text Blocks (Preview) (JEP 355):
Another preview language feature, this JEP is "a follow-on effort to explorations begun in JEP 326 (Raw String Literals), which was pulled back from the Java 12 release. Raw string literals can span multiple lines of source code and do not interpret escape sequences. JEP 355 proposes adding text blocks to the Java language. A text block is a multi-line string literal that avoids the need for most escape sequences, automatically formats the string in a predictable way, and gives the developer control over format when desired.
Oracle plans to deliver at least two updates to this release during its Critical Patch Update (CPU) schedule before the release of Oracle JDK 14, which is due n March 2020, with early access builds already available.
John has been covering the high-tech beat from Silicon Valley and the San Francisco Bay Area for nearly two decades. He serves as Editor-at-Large for Application Development Trends (www.ADTMag.com) and contributes regularly to Redmond Magazine, The Technology Horizons in Education Journal, and Campus Technology. He is the author of more than a dozen books, including The Everything Guide to Social Media; The Everything Computer Book; Blobitecture: Waveform Architecture and Digital Design; John Chambers and the Cisco Way; and Diablo: The Official Strategy Guide.