Oracle has announced the availability of Java 19 and Oracle JDK 19 for developers, the latest versions of what is arguably the world's most popular programming language.
JDK (Java Development Kit) 19 arrives about six months after Java 18 and exactly a year after Java 17 – the most recent long-term support (LTS) release of Java.
With the release of Java 17, Oracle announced plans to move JDK LTS releases from every three years to every two years, meaning the next LTS release will be Java 21 in September 2023.
The open-source version of JDK 19 OpenJDK 19 is also available from Oracle under the GNU General Public License, version 2, with the Classpath Exception.
Also: The most popular programming languages and where to learn them
Oracle now releases new versions of Java every six months in March and September with the aim of giving developers smaller but more frequent updates than its previous big-bang updates every few years. LTS releases remain supported for at least eight years.
As noted by Sharat Chander, Oracle's director of Java SE product management, JDK 17 was the second LTS under the release cadence announced in 2018. With it, Oracle introduced "new and simpler license terms" that allowed companies to use it at "no cost for at least the next three years, allowing one full year of overlap with the next LTS release."
Oracle explained at the time that JDK 17 and future JDK releases are provided under Oracle's No-Fee Terms and Conditions (NFTC) license, a free-to-use license for Java 17. The license lasts for a year after the next LTS release and then Java 17 moves under the Oracle Technology Network License.
Java 17 was a big deal. A survey by Java dev tool maker Perforce earlier this year found that 37% of its users were still on Java 8, which was released in March 2014. A further 29% used Java 11, released in September 2018. Both are LTS releases. Some 37% of the Perforce's 876 Java users planned to move to Java 17 LTS.
There's Java the programming language and then there are several Java platforms that Java apps run in, consisting of the Java Virtual Machine or "JVM" and its application-programming interfaces. The two main platforms are Java Standard Edition (Java SE) and Java Enterprise Edition (Java EE).
Chander notes that "Java SE subscribers get access to Oracle's Java SE Support and commercial features such as GraalVM Enterprise, Java Management Service and the Advanced Management Console," pointing users to The New Java SE License Terms blog for details about the license.
As for new technical features, Java 19 includes seven JDK enhancement proposals (JEP), but they're mostly preview or incubator features.
Notably, Java 19 includes JEP 422 - Linux/RISC-V Port, which ports the JDK to the open-source Linux RISC-V architecture. RISC-V has in various measures won the support of Intel via its new foundry services business and NASA, which wants to use RISC-V chips for its next-generation spaceflight computers.
The RISC-V (pronounced "risk-five") standard was invented by University of California Berkeley professors David Patterson and Krste Asanović 12 years ago. Developers are free to change a RISC-V chip's instruction set architecture (ISA) versus the closed ISAs of Intel x86 and Arm processors.
Another interesting addition is JEP 425 "Virtual Threads (Preview)" for the Java platform. Virtual Threads is the first JEP as part of Project Loom, a multi-year effort to improve Java's performance on large server applications.
"Virtual Threads are lightweight threads that dramaticaly reduce the effort of writing, maintaining, and observing high-throughput concurrent applications," note the proposal's authors.
Also: How to run websites as apps with ease in Linux
Chander explains the benefits of virtual threads versus Java's threads and how Project Loom aims to come up with an alternative to the three "bad options" developers have, which is to waste hardware through underutilization, waste programmer effort with worse programming models and observability, or switch away from Java.
"There are a lot of great things about Java's threads. They offer a natural programming model, with readable, sequential code using control flow operators that users understand – loops, conditionals, exceptions. Users get great debugging and serviceability, and readable stack traces. And threads are natural units of scheduling for OSes," Chander points out.
"The problem is that the implementation of threads by the OS is too heavyweight. It takes too long to start a thread for each connection, but worse, the number of threads the OS can support at any one time limits the number of concurrent transactions a server can handle – to well below the capacity of the hardware or the network – and so threads become a severe constraining factor on server throughput."
He said many people assumed Oracle would embrace the asynchronous programming style offered by so-called "reactive" frameworks but added: "Reactive may be the best people can do with the current JVM, but our goal is to do better, which we can do by making threads lighter and more scalable, letting developers keep using the model and tooling they've been using successfully for years."
Here's a list of all seven JEPs in Java 19:
|405:||Record Patterns (Preview)|
|424:||Foreign Function & Memory API (Preview)|
|425:||Virtual Threads (Preview)|
|426:||Vector API (Fourth Incubator)|
|427:||Pattern Matching for switch (Third Preview)|
|428:||Structured Concurrency (Incubator)|