Future Tech

Oracle brews Java 23 for just-in-time delivery

Tan KW
Publish date: Tue, 17 Sep 2024, 10:45 PM
Tan KW
0 478,433
Future Tech

Oracle on Tuesday released Java 23 (Oracle JDK 23), in keeping with its now well-established six-month cadence.

No one should be surprised by this because predictability is part of the plan. Enterprise customers with Java applications don't want to be surprised.

"We've been releasing like clockwork every six months, March and September," Chad Arimura, VP of Java developer relations at Oracle, told The Register. "And this has been going very smoothly and very well.

"And in fact, people who were initially very skeptical, as Georges [Saab, SVP of development for the Java platform group], likes to say, even people in his own engineering group were skeptical of this even being possible.

"We're seven years in and people, I mean, we commonly hear that this is the best thing that's happened to Java."

That's not to say there's no novelty. Java 23 incorporates 12 JDK Enhancement Proposals, or JEPs, that add new capabilities to the programming language, not to mention bug fixes, security improvements, and other tweaks.

In the spirit of caution, many of these JEPs are presented in preview form to incorporate community feedback for revision in a subsequent release.

For example, Implicitly Declared Classes and Instance Main Methods (JEP 477) appears as a Third Preview. It builds upon JEP 445, previewed in JDK 21, and JEP 463 from JDK 22, with an eye toward making Java code more approachable for novices by requiring less code. The goal is to make a simple "Hello, World!" program easy to write.

"Implicitly declared classes … makes it much, much more succinct to write your first program," said Arimura. "But not just your first program. I use it for demos all day long."

Making Java more approachable for novices matters for the health of the Java ecosystem as other languages like Python and JavaScript have become more common as a first programming language for students.

Oracle remains keen to remind people that Java is the "#1 language for today's Technology Trends" - without defining those trends - and the "#1 language for Overall Enterprise/IT Organization Use."

The GitHut 2.0 project ranks Java second, behind Python, as measured by pull requests on GitHub. Based on GitHub stars, Java ranks fifth, behind Python, JavaScript, Go, and C++.

Java 23 is a Feature release, eligible for six months of support from Oracle. The next LTS release, supported for eight years, is Java 25, due in September 2025.

In addition to JEP 477 above, the JEPs arriving with Java 23 include:

Arimura said that one of the things Oracle's Java team has been focused on is integrity by default, an effort that involves making it harder to use internal private APIs.

"People have commonly done this," Arimura explained, "and we're really working on continuing to move people to alternative APIs that are public."

Doing so helps make the Java platform safer. Along these lines, JEP 471 deprecates unsafe memory access methods in preparation for eventual removal. Arimura said alternative APIs are provided through the Panama project, among other things.

Arimura said it is difficult to pick a favorite new addition to the language but pointed to JEP 474, ZGC (Z Garbage Collector) now defaulting to generational mode, meaning it manages differently aged objects more effectively.

He also voiced appreciation for JEP 476. "I'm kind of a language guy, so things like module import declarations make it a lot easier to import all the packages that a module exports by one line of code instead of seven or eight or importing dot star packages," Arimura said.

The Graal JIT (just-in-time) compiler is now included among the JITs in Oracle JDK 23, having previously been available only through the GraalVM.

"Starting with JDK 23, Oracle JDK is going to include the Graal JIT," said Donald Smith, VP of product management. "And the way I like to think of it is it's kind of like a developer or a system administrator has access to different garbage collectors, depending on what kind of workload they're dealing with. We're making the Graal JIT as an option for developers as well. There are some workloads where the Graal JIT is going to be faster, especially at startup, especially if you're creating a lot of objects."

However, the GraalVM will remain a separate JDK download. "If you wanted to use native image, the ahead-of-time compilation, if you wanted to use the Graal polyglot feature, so if you were trying to co-locate an application with JavaScript or Scala or something like that, or using ahead-of-time compilation for those languages, you would still use the separate GraalVM for JDK download," said Smith. "This is all about a convenience for those that want to see if the Graal JIT helps with their own application."

Arimura addressed concerns raised on a recent call about whether the large portion of preview JEPs reflects a slowdown in platform development.

"I kind of paused for a minute because it really feels to me, and I think other people on the team, this is actually an indicator that things are working and going very quickly, but quickly, thoughtfully, ensuring that we're going through a preview system to get feedback, to make sure they're putting designs out there," he said.

"We think they're like 99 percent of the way there, but we want to make sure that people recognize that they might change and we want to get sort of last feedback and evolve that before they become final, because if they become final, they're going to be that way for a very long time."

As if to signal Java's vitality, JavaOne, a community-run developer event, will take place in the San Francisco Bay Area from March 17-20, 2025, after a two-year hiatus. ®

 

https://www.theregister.com//2024/09/17/oracle_java_23/

Discussions
Be the first to like this. Showing 0 of 0 comments

Post a Comment