New Java Release: What Changed in JDK 23

Online Python Trainer for Beginners

Learn Python easily without overwhelming theory. Solve practical tasks with automatic checking, get hints in Russian, and write code directly in your browser — no installation required.

Start Course

New Java Release: What Changed in JDK 23



The developer community has welcomed the long-awaited release of JDK 23 — another planned update to the Java platform. Although this version is not a long-term support (LTS) release, it introduces a number of significant innovations that can already simplify the lives of Java developers. Let's figure out what has changed and why you should upgrade as soon as possible.



Key Changes in JDK 23



The new release focuses on improving performance, security, and development convenience. Here are the main innovations:



  • Flexible Constructor Bodies (Preview). A long-awaited feature that allows writing logic before calling the superclass constructor. Previously, this was impossible due to JVM limitations. Now you can perform checks and field initialization before calling super(), making the code cleaner and safer.
  • Module Import Declarations (Preview). A new ability to import all modules with a single expression. Instead of dozens of import lines, you can write import module java.base;. This significantly reduces boilerplate code, especially when working with the standard library.
  • Stream Gatherers (Preview). A powerful extension to the Stream API. Now you can create your own intermediate operations for data streams. This opens the door to custom operations that previously required writing complex collectors or reductions.
  • Deprecation of the Security Manager. Oracle's final decision is to remove the Security Manager in future versions. In JDK 23, it is marked as deprecated for removal. Developers are recommended to migrate to modern alternatives, such as the Java module system (JPMS) and OS-level security policies.


Performance and JVM Improvements



In addition to language innovations, JDK 23 brought a number of under-the-hood optimizations:



  • Vector API (Eighth Incubator). Work on computation vectorization continues. The new incubator improves support for SIMD instructions, which is critical for scientific calculations and image processing.
  • Region Pinning for G1. An improvement to the G1 garbage collector — it can now "pin" objects in the heap without blocking the entire collection. This reduces latency in real-time systems and low-latency applications.
  • String Templates (Preview). Improved string interpolation that allows safely embedding expressions directly into string literals. This is not just syntactic sugar but also protection against SQL injection when working with queries.


What Does This Mean for Developers?



JDK 23 is a step towards a more modern and expressive Java. Although many features are still in Preview status, they can already be tested in production by enabling the appropriate compiler flags. We recommend starting with Stream Gatherers and Flexible Constructor Bodies — they are the most in demand in everyday development.



If you are using Java 17 or 21 (LTS versions), switching to JDK 23 is not mandatory, but it is extremely useful for getting acquainted with the future of the language. Stay tuned for updates on PythonLib — we will continue to cover the most important changes in the Java world.

Recommended Libraries