Java 23 will be released on September 17th but it's branched today (June 6th 2024) and so its feature set is final. Generational ZGC, Markdown in Javadoc, deprecations in Unsafe, the removal of string template, and the thoughtful evolution of eight preview features.
Let's take a closer look!
The feature set for Java Development Kit (JDK) 23, the next planned version of standard Java, has been finalized at an even dozen. A proposed third preview of string templates, which was also previewed in JDK 22 and JDK 21, has been dropped from JDK 23.
Due September 17, JDK 23 will include third previews of scoped values, structured concurrency, and implicitly declared classes and instance methods, and second previews of flexible constructor bodies, stream gatherers, and a class-file API. JDK 23 will also include module import declarations, Markdown documentation comments, an eighth incubation of a vector API, and a preview of primitive types in patterns, instance of, and switch
. And the release will deprecate the memory access methods in sun.misc.UnSafe
and make the generational mode of the Z Garbage collector the default mode.
JDK 23 will be a non-LTS (Long Term Support) release with only six months of support from Oracle, unlike JDK 21, which is an LTS release with several years of support. Early access builds for JDK 23 can be accessed from jdk.java.net.
Scoped values, previewed previously in JDK 22 and JDK 21, enable a method to share immutable data both with its callees within a thread and with child threads. Scoped values are easier to reason about than thread-local values and they have lower space and time costs, particularly when used together with virtual threads and structured concurrency, the proposal states. The preview of scoped values in JDK 23 introduces one change from the previous previews: The type of the operation parameter on the ScopedValue.callWhere
method is a new functional interface that allows the Java compiler to infer whether a checked exception might be thrown. With this change, the ScopeValue.getWhere
method is no longer needed and has been removed.
Plans for JDK 23 also call for deprecating the memory-access methods in sun.misc.Unsafe
for removal in a future release. These methods are unsupported and they have been superseded by standard APIs, namely the VarHandle API and the foreign function and memory API. Library developers are encouraged to migrate from sun.misc.Unsafe
to supported replacements, so applications can migrate smoothly to modern JDK releases. Goals of the proposal include preparing the ecosystem for removal of memory access methods in sun.misc.Unsafe
in a future JDK release, and helping developers realize when their applications rely, directly or indirectly, on those memory access methods. It is not a goal to remove sun.misc.Unsafe
entirely, as a small number of its methods are not used for memory access. These methods will be deprecated and removed separately.
According to New Relic’s fourth annual State of the Java Ecosystem report released today, Java remains one of the most popular languages among developers nearly three decades on due to its “scalability and portability, allowing users to run on any device with a Java virtual machine.”
The report, based on data from hundreds of thousands of applications, provides insights into how developers are utilising Java and which versions are gaining traction. Two key findings highlight the accelerating adoption of recent releases:
- “Java 21 sees higher adoption than Java 17: Following the release of Java 21 in September 2023, the report found that the adoption rate for the latest Java LTS version was 287% higher in the first six months after release than its previous LTS counterpart, Java 17.”
- “Java 17 overtakes Java 11 as the most-used LTS version: The Java 17 growth rate exploded to a nearly 300% year-over-year (YoY) increase, with over 35% of applications using Java 17 in production this year compared to 9% in 2023. To put this growth into perspective, it took years for Java 11 to reach a similar growth rate.”
This rapid migration to newer versions can likely be attributed to the improvements in “stability, security, and performance” that developers value, according to the report. Oracle, the steward of Java, releases updates every six months with long-term support (LTS) versions arriving every two years.
The report also shed light on trends among Java distributions and complementary tools:
- While Amazon’s distribution remains popular at 18% usage, its share dropped 43% year-over-year as the community-led Eclipse Adoptium made gains, increasing 50% to an 18% usage share.
- New Relic’s data revealed that Log4j is the most popular logging framework, with 76% of Java applications that report to New Relic using it—followed by JBoss Logging (61%) and Logback (52%).
- Bouncy Castle topped the list as the most popular library for encryption, with 17% of Java applications using it. 16 percent use Spring Security and six percent use Jasypt.
- Oracle Database takes pole position among databases with 17 percent, followed by PostgreSQL (14%) and MySQL (13%).
To gather qualitative insights, New Relic analysed queries to its AI observability assistant from Java developers. “The most common types of Java-related questions and requests asked by developers using the New Relic AI generative AI observability assistant include how-to type questions (34%), followed by querying for a specific metric (21%), and troubleshooting (14%).”
Java’s enduring popularity nearly 30 years after its birth is a testament to the language’s excellence and the robust community surrounding it. The sweeping report makes clear that far from fading away, Java remains an essential tool driving countless production applications worldwide.
Comments
Post a Comment