Engineering Blog

Oracle Releases Java 22 with Foreign Function and Memory API, Unnamed Variables and More

Oracle released Java 22, the latest version of the Java programming language and virtual machine. This is the first non-LTS release since JDK 21 and includes 12 JEPs (Java Enhancement Proposals).

Key Features of Java 22:

  • Foreign Function & Memory API (JEP 454): This feature allows Java code to interoperate with native code and memory, improving performance for certain tasks.
  • Unnamed Variables & Patterns (JEP 456): This feature introduces unnamed variables and patterns to simplify code.
  • Implicitly Declared Classes and Instance Main Methods (Second Preview) (JEP 463): This feature aims to make it easier for beginners to write Java programs.

Predictions for JDK 23

While only one JEP has been officially targeted for JDK 23, several JEP candidates are strong contenders for inclusion. These include:

  • Primitive Types in Patterns, instanceof, and switch (Preview) (JEP 455): This JEP enhances pattern matching and extends instanceof and switch to work with primitive types.
  • Derived Record Creation (Preview) (JEP 468): This JEP simplifies creating new records from existing records.
  • Markdown Documentation Comments (Candidate) (JEP 467): This JEP allows JavaDoc comments to be written in Markdown for easier writing and reading.
  • Class-File API (Second Preview) (JEP 466): This JEP provides an API for working with Java class files.
  • String Templates (Second Preview) (JEP 465): This JEP enhances Java with string templates for improved string formatting.

Availability

JDK 22 is now available for download from Oracle. Binaries from other vendors are expected to be available soon.

Stay Updated

Keep an eye on engineering.01cloud articles for more details on upcoming Java features and the official release of JDK 23.

Previous Post