Significant Changes in JDK 17 Release
See JDK 17 Release Notes for additional descriptions of the new features and enhancements, and API specification in JDK 17.
The following are some of the updates in Java SE 17 and JDK 17:
New Language Feature
- Sealed Classes, first previewed in Java SE 15, is a permanent feature in this release. Sealed classes and interfaces restrict which other classes or interfaces may extend or implement them. See JEP 409: Sealed Classes and Sealed Classes in Java Platform, Standard Edition Java Language Updates guide.
Library Changes
- Applications can now configure context-specific and dynamically selected deserialization filters using a JVM-wide filter factory, which is invoked to select a filter for each individual deserialization operation. See JEP 415: Context-Specific Deserialization Filters and Serialization Filtering in Java Platform, Standard Edition Core Libraries guide.
- New interface types and implementations for pseudo-random number generators (PRNGs) are now available, including jumpable PRNGs and an additional class of splittable PRNG algorithms (LXM). See JEP 356: Enhanced Pseudo-Random Number Generators and Pseudorandom Number Generators in Java Platform, Standard Edition Core Libraries guide.
- New Java 2D internal rendering pipeline for macOS is implemented using the Apple Metal API. This is an alternative to the existing pipeline, which uses the deprecated Apple OpenGL API. See JEP 382: New macOS Rendering Pipeline.
Other Changes
- By default, all internal elements of the JDK are strongly
encapsulated, except for critical internal APIs such as
sun.misc.Unsafe
. However, it will no longer be possible to relax the strong encapsulation of internal elements using a single command-line option, as it was possible in JDK 9 through JDK 16. See JEP 403: Strongly Encapsulate JDK Internals by Default. - The floating-point operations are now consistently strict, rather
than having both strict floating-point semantics (
strictfp
) and subtly different default floating-point semantics. See JEP 306: Restore Always-Strict Floating-Point Semantics.
Deprecations
- The Security Manager and APIs related to it have been deprecated for removal in a future release. See JEP 411: Deprecate the Security Manager for Removal.
Preview Features and Incubator Modules
See JEP 12: Preview Features for more information about preview features and JEP 11: Incubator Modules for more information about incubator modules.
- Pattern matching for
switch
expressions and statements is introduced in this release. This feature allows an expression to be tested against a number of patterns, each with a specific action, so that complex data-oriented queries can be expressed concisely and safely. See JEP 406: Pattern Matching for switch (Preview) and Pattern Matching for Switch Expressions and Statements in Java Platform, Standard Edition Java Language Updates guide. - Foreign Function & Memory API allows Java programs to interoperate with code and data outside of the Java runtime. See JEP 412: Foreign Function & Memory API (Incubator).
- The Vector API was introduced in Java SE 16 as an incubating API. In this release, enhancements have been incorporated along with performance improvements. See JEP 414: Vector API (Second Incubator).
Removed APIs, Tools, and Components
See:
In addition, there are security related updates that you need to be aware of. See: Security Updates in JDK 17.