Java 19 Comes with an Open-Source Twist! All You Need to Know


Take a look at Java 19 which delivers thousands of performance, stability, and security improvements!

On 20th September, Oracle announced the availability of Java 19, the latest version of the world’s number one programming language and development platform. Java 19 (Oracle JDK 19) delivers thousands of performance, stability, and security improvements, including enhancements to the platform that will help developers improve productivity and drive business-wide innovation. Oracle will showcase the latest capabilities in Java 19 at JavaOne 2022, taking place in October in Las Vegas.

Java Development Kit 19, a non-LTS (long-term support) release of standard Java, arrives today as a production release. Multiple features target the release including structured concurrency, record patterns, a preview of a foreign function and memory API, and support for the open-source Linux/RISC-V instruction set architecture (ISA). All features but the Linux/RISC-V capability are either in preview or incubator phases.

The latest Java Development Kit (JDK) provides updates and improvements with seven JDK Enhancement Proposals (JEPs). Most of these updates are to be delivered as follow-up preview features improving on functionality introduced in earlier releases.

JDK 19 delivers language Improvements from OpenJDK project Amber (Record Patterns and Pattern Matching for Switch); library enhancements to interoperate with non-Java Code (Foreign Function and Memory API) and to leverage vector instructions (Vector API) from OpenJDK project Panama; and the first previews for Project Loom (Virtual Threads and Structured Concurrency), which will drastically reduce the effort required to write and maintain high-throughput, concurrent applications in Java.


Driving Java Innovation in the Cloud

  • The Java 19 release results from the extensive collaboration between Oracle engineers and other members of the worldwide Java developer community via the OpenJDK Project and the Java Community Process (JCP). In addition to new enhancements, Java 19 is supported by Java Management Service—an Oracle Cloud Infrastructure (OCI) native service—that provides a single pane of glass to help organizations manage Java runtimes and applications on-premises or on any cloud.
  • Java 19 provides us with six preview and incubator features, i.e., features that have not yet been completed but can already be tested by the developer community. The feedback from the community is usually incorporated into the further development and completion of these features.
  • In Java 19, JDK Enhancement Proposal 427 changed the syntax of the so-called “Guarded Pattern” (in the example above “String s && s.length() > 5”). Instead of &&, we now have to use the new keyword when.
  • Structured concurrency, in an incubator phase, is intended to simplify multithreaded programming through a structured concurrency API. This concurrency treats multiple tasks running in different threads as a single work unit to streamline error handling and cancellation. Reliability and observability are improved. This feature is from Project Loom, which introduced a new lightweight concurrency model.
  • A preview of record patterns, to deconstruct record values. Record patterns and type patterns can be nested to enable a declarative, robust, and composable form of data navigation and processing. The goals of the proposal include extending pattern matching to express more sophisticated, composable data queries while not changing the syntax or semantics of type patterns.
  • A preview of a foreign function and memory API, which would introduce an API by which Java programs can interoperate with code and data outside the Java runtime. By efficiently invoking foreign functions (i.e., code outside the JVM) and safely accessing foreign memory (i.e., memory not managed by the JVM) the API enables Java programs to call native libraries and process native data without the danger and brittleness of the Java Native Interface (JNI).
  • The third preview of pattern matching for switch expressions and statements, extending pattern matching to switch, allows an expression to be tested against a number of patterns, each with a specific action, so complex data-oriented queries can be expressed concisely and safely. This capability previously was previewed in JDK 17 and JDK 18.

The post Java 19 Comes with an Open-Source Twist! All You Need to Know appeared first on Analytics Insight.

Source link