Feature Summary: Java SE 17

FeatureDescriptionJSR/JEPReleased in
Microbenchmark SuiteProvides a suite of microbenchmarks to help developers benchmark the performance of Java APIs and features.JEP 230Java SE 12
JVM Constants APIIntroduces an API to model nominal descriptions of key class-file and run-time artifacts, primarily for the benefit of compilers and tools.JEP 334Java SE 12
Default CDS ArchivesEnhances the JDK build process to generate a class data-sharing (CDS) archive, which can improve startup time.JEP 341Java SE 12
Abortable Mixed Collections for G1Improves G1 garbage collector to abort mixed collections if they exceed a certain duration, improving efficiency.JEP 344Java SE 12
Promptly Return Unused Committed Memory from G1Enhances G1 to more promptly return unused Java heap memory to the operating system during full GC cycles.JEP 346Java SE 12
Dynamic CDS ArchivesAdds dynamic archiving of classes at the end of application execution to improve startup time for subsequent executions.JEP 350Java SE 13
Reimplement the Legacy Socket APIReplaces the underlying implementation used by the java.net.Socket and java.net.ServerSocket APIs to improve simplicity and maintainability.JEP 353Java SE 13
JFR Event StreamingExtends Java Flight Recorder (JFR) to provide a continuous stream of events with minimal performance impact.JEP 349Java SE 14
Helpful NullPointerExceptionsEnhances the NullPointerException to provide more helpful diagnostic information to precisely identify the null-reference operation.JEP 358Java SE 14
Switch ExpressionsStandardizes switch expressions and introduces the yield statement to return a value from switch expressions.JEP 361Java SE 14
NUMA-Aware Memory Allocation for G1Enables G1 to automatically respect the NUMA topology of the system, improving performance on NUMA-capable systems.JEP 345Java SE 14
Edwards-Curve Digital Signature Algorithm (EdDSA)Adds cryptographic algorithm that provides security equivalent to other NIST P-256 algorithms, but faster.JEP 339Java SE 15
Hidden ClassesIntroduces hidden classes that cannot be used directly by the bytecode of other classes, intended for frameworks which generate classes at runtime.JEP 371Java SE 15
Reimplement the Legacy DatagramSocket APIUpdates the older DatagramSocket API with a simpler, more modern implementation, similar to the stream socket API.JEP 373Java SE 15
ZGC: A Scalable Low-Latency Garbage CollectorA scalable low-latency garbage collector (ZGC) to reduce pause times during GC without compromising throughput. Introduced in JEP 333 (Java SE 11).JEP 377Java SE 15
Text BlocksFor multi-line string literals that minimise the need for most escape sequences, simplifying the authoring of JSON and SQL queries. Introduced in JEP 355 (Java SE 13).JEP 378Java SE 15
Shenandoah: A Low-Pause-Time Garbage CollectorA low-pause-time garbage collector to reduce GC pause times by performing more garbage-collection work concurrently with the application threads. Introduced in JEP 189 (Java SE 12).JEP 379Java SE 15
Enable C++14 Language FeaturesUpdates the JDK’s C++ source code to use C++14 language features, improving JDK’s security and maintainability.JEP 347Java SE 15
Migrate from Mercurial to GitMoves all OpenJDK source code repositories from Mercurial to Git, facilitating version control with modern tooling.JEP 357Java SE 16
Migrate to GitHubTransfers all Git repositories to GitHub, enhancing the collaboration and contribution process for the OpenJDK community.JEP 369Java SE 16
Concurrent Thread-Stack Processing in ZGCEnhances ZGC to process thread stacks concurrently with other GC operations, reducing pause times further.JEP 376Java SE 16
Unix-Domain Socket ChannelsAdds support for Unix-domain (local) socket channels that allow inter-process communication on the same host more efficiently than TCP/IP.JEP 380Java SE 16
Elastic MetaspaceReduces the metaspace footprint of Java applications by returning unused class metadata memory to the operating system more promptly.JEP 387Java SE 16
Windows/AArch64 PortAdds support for Windows on the AArch64 architecture, ensuring Java can run on modern ARM-based Windows devices.JEP 388Java SE 16
Warnings for Value-Based ClassesGenerates warnings for any attempt to synchronize on instances of value-based classes, discouraging incorrect usage patterns.JEP 390Java SE 16
Packaging ToolIntroduces the jpackage tool to package Java applications into platform-specific packages, facilitating application deployment.JEP 392Java SE 16
Pattern Matching for instanceofSimplifies the instanceof operator to eliminate the need for manual type casting in many cases, enhancing code readability and reducing boilerplate. Introduced in JEP 305 (Java SE 14).JEP 394Java SE 16
RecordsProvides a compact syntax for declaring classes that are transparent holders for shallowly immutable data. Introduced in JEP 359 (Java SE 14).JEP 395Java SE 16
Enhanced Pseudo-Random Number GeneratorsEnhances the pseudo-random number generators in Java, providing new interfaces and implementations for random number generation.JEP 356Java SE 17
macOS/AArch64 PortAdds support for macOS on AArch64, enabling Java to run on new Apple Silicon (M1) Macs.JEP 391Java SE 17
Strongly Encapsulate JDK InternalsStrengthens the encapsulation of JDK internal APIs to prevent their use by external APIs, improving JDK security and maintainability.JEP 403Java SE 17
Sealed ClassesTo restrict which other classes or interfaces may extend or implement them, enhancing the control over API design. Introduced in JEP 360 (Java SE 15).JEP 409Java SE 17
Remove the Experimental AOT and JIT CompilerRemoves the experimental ahead-of-time (AOT) and just-in-time (JIT) compiler, simplifying the JDK and focusing on more broadly used features.JEP 410Java SE 17
Context-Specific Deserialization FiltersEnhances security by allowing applications to configure context-specific filters for deserialization, reducing the risk of deserialization vulnerabilities.JEP 415Java SE 17

Tools

Java SE 17 introduced several tools and utilities aimed at enhancing developer productivity and simplifying the development process.

  • Microbenchmark Suite: Provides a suite of microbenchmarks to help developers benchmark the performance of Java APIs and features (JEP 230).
  • Packaging Tool: Introduces the jpackage tool to package Java applications into platform-specific packages, facilitating application deployment (JEP 392).
  • JFR Event Streaming: Extends Java Flight Recorder (JFR) to provide a continuous stream of events with minimal performance impact (JEP 349).

Java Syntax

This category includes fundamental changes and updates to the Java programming language, enhancing readability and reducing boilerplate code.

  • Switch Expressions: Standardises switch expressions and introduces the yield statement to return a value from switch expressions (JEP 361).
  • Pattern Matching for instanceof: Simplifies the instanceof operator to eliminate the need for manual type casting in many cases, enhancing code readability and reducing boilerplate (JEP 394).
  • Records: Provides a compact syntax for declaring classes that are transparent holders for shallowly immutable data (JEP 395).
  • Sealed Classes: To restrict which other classes or interfaces may extend or implement them, enhancing control over API design (JEP 409).
  • Text Blocks: For multi-line string literals that minimize the need for most escape sequences, simplifying the authoring of JSON and SQL queries (JEP 355).
  • Warnings for Value-Based Classes: Generates warnings for any attempt to synchronize on instances of value-based classes, discouraging incorrect usage patterns (JEP 390).

Libraries

Enhancements and additions to the Java standard API, providing new capabilities and simplifying common tasks.

  • Enhanced Pseudo-Random Number Generators: Enhances the pseudo-random number generators in Java, providing new interfaces and implementations for random number generation (JEP 356).
  • Unix-Domain Socket Channels: Adds support for Unix-domain (local) socket channels that allow inter-process communication on the same host more efficiently than TCP/IP (JEP 380).
  • Reimplement the Legacy Socket API: Replaces the underlying implementation used by the java.net.Socket and java.net.ServerSocket APIs to improve simplicity and maintainability (JEP 353).
  • Reimplement the Legacy DatagramSocket API: Updates the older DatagramSocket API with a simpler, more modern implementation, similar to the stream socket API (JEP 373).

Performance & Security

Updates and improvements to the JVM and garbage collection, focusing on performance, security, and robustness.

  • Dynamic CDS Archives: Adds dynamic archiving of classes at the end of application execution to improve startup time for subsequent executions (JEP 350).
  • Default CDS Archives: Enhances the JDK build process to generate a class data-sharing (CDS) archive, which can improve startup time (JEP 341).
  • JVM Constants API: Introduces an API to model nominal descriptions of key class-file and run-time artifacts, primarily for the benefit of compilers and tools (JEP 334).
  • Abortable Mixed Collections for G1: Improves G1 garbage collector to abort mixed collections if they exceed a certain duration, improving efficiency (JEP 344).
  • Promptly Return Unused Committed Memory from G1: Enhances G1 to more promptly return unused Java heap memory to the operating system during full GC cycles (JEP 346).
  • NUMA-Aware Memory Allocation for G1: Enables G1 to automatically respect the NUMA topology of the system, improving performance on NUMA-capable systems (JEP 345).
  • Hidden Classes: Introduces hidden classes that cannot be used directly by the bytecode of other classes, intended for frameworks that generate classes at runtime (JEP 371).
  • Shenandoah: A Low-Pause-Time Garbage Collector: A low-pause-time garbage collector to reduce GC pause times by performing more garbage-collection work concurrently with the application threads (JEP 379).
  • ZGC: A Scalable Low-Latency Garbage Collector: A scalable low-latency garbage collector (ZGC) to reduce pause times during GC without compromising throughput (JEP 377).
  • Concurrent Thread-Stack Processing in ZGC: Enhances ZGC to process thread stacks concurrently with other GC operations, reducing pause times further (JEP 376).
  • Edwards-Curve Digital Signature Algorithm (EdDSA): Adds a cryptographic algorithm that provides security equivalent to other NIST P-256 algorithms but faster (JEP 339).
  • Elastic Metaspace: Reduces the metaspace footprint of Java applications by returning unused class metadata memory to the operating system more promptly (JEP 387).
  • Strongly Encapsulate JDK Internals: Strengthens the encapsulation of JDK internal APIs to prevent their use by external APIs, improving JDK security and maintainability (JEP 403).
  • Remove the Experimental AOT and JIT Compiler: Removes the experimental ahead-of-time (AOT) and just-in-time (JIT) compiler, simplifying the JDK and focusing on more broadly used features (JEP 410).
  • Context-Specific Deserialization Filters: Enhances security by allowing applications to configure context-specific filters for deserialization, reducing the risk of deserialization vulnerabilities (JEP 415).

Other

  • Enable C++14 Language Features: Updates the JDK’s C++ source code to use C++14 language features, improving JDK’s security and maintainability (JEP 347).
  • Migrate from Mercurial to Git: Moves all OpenJDK source code repositories from Mercurial to Git, facilitating version control with modern tooling (JEP 357).
  • Migrate to GitHub: Transfers all Git repositories to GitHub, enhancing the collaboration and contribution process for the OpenJDK community (JEP 369).
  • Windows/AArch64 Port: Adds support for Windows on the AArch64 architecture, ensuring Java can run on modern ARM-based Windows devices (JEP 388).
  • macOS/AArch64 Port: Adds support for macOS on AArch64, enabling Java to run on new Apple Silicon (M1) Macs (JEP 391).