JDK 18/Java 18 was released last month, and JDK 19 is scheduled to be released in September this year, so before many developers can use Java 18, two of the latest target features about Java 19 have been revealed.
There are two official features that will be released in the next version. One is the Vector API, and the other is the porting of the JDK to RISC-V. The former Vector API is an API that expresses vector computation and will be incubated for the fourth time in the next Java release; the latter proposed feature is the porting of the JDK to the open source Linux/RISC-V instruction set architecture (ISA).
While JDK 19 may host a large number of features such as generic generics, value objects, and record patterns, so far only two features have been officially proposed for JDK 19, the Vector API and porting to RISC-V.
According to InfoWorld, Java 19 is likely to carry a large number of features, from generic generics to value objects, according to the ongoing Java enhancement plan. Among them, the two latest features officially specified in Java 19 are: Vector API for expressing vector computation, which will be incubated for the fourth time in the next version of Java; and the JDK all the way to the open source Linux/RISC-V Instruction Set Architecture (ISA).
- Vector API for expressing vector calculations that can be reliably compiled at runtime to the best vector instructions on the supported CPU architectures. Developers using this API can use HotSpot, which supports automatic vectorization, based on a user model, thus gaining a way to write complex vector algorithms in Java, making vectorization more predictable and robust.
At the time of development and design, the main goals of this API included four aspects. One, the API is able to express a wide range of vector computations in a clear and concise manner; two, the API is CPU architecture independent and can be implemented on multiple architectures that support vector instructions; three, it has reliable runtime and compilation performance on x64 and AArch64 architectures; and four, it enables “graceful” degradation to cope with the situation where vector computations are not fully expressed as a sequence of vector operations at runtime. The Vector API has previously been included in JDK 16, JDK 17, and JDK 19.
- With the Linux/RISC-V port, Java will gain support for a hardware instruction set that is already supported by a wide range of language toolchains. In fact, RISC-V is a family of related ISAs. According to officials, the Linux/RISC-V port will only support the RV64GV configuration of RISC-V, a generic 64-bit ISA that includes vector instructions. Java developers may consider other RISC-V configurations in the future.
The port will support the following HotSpot VM options: template interpreter, C1 (client) JIT compiler, C2 (server) JIT compiler, and all current mainline garbage collectors, including ZGC and Shenandoah. the actual port is nearly complete; the JDK Enhancement Proposal (JEP) is focused on integrating the port into the JDK mainline library.
In addition to these two features, Foreign Function and Memory APIs that allow Java programs to interoperate with code and data outside of the JVM runtime may also appear in Java 19.
What is worth your attention is that, like Java 18, Java 19 is also a non-LTS version with a six-month support period, so it is not really recommended to use it directly in production environments, but the features are available for sampling.
According to the official release schedule, JDK 19 will be released in GA on September 20, preceded by Rampdown phases on June 9 and July 21, and release candidates on August 11 and August 21.
Like JDK 18, JDK 19 will be a short-term release, with only six months of support. The current latest LTS release is JDK 17 on September 14, 2021, and the next LTS release will be JDK 21 in September 2023.