logo

What's new in Java 21

Last Updated: 2022-03-06

Java 21 will likely be the next LTE version, to be eleased in 2023. This page summarizes changes in Java 18, 19, 20 and 21.

Spec / Language

JEP 420: Pattern Matching for switch (Second Preview)

Core Java Library

  • JEP 400: UTF-8 by Default (java.nio.charsets)
  • JEP 408: Simple Web Server (java.net)
  • JEP 416: Reimplement Core Reflection with Method Handles (java.lang.reflect)
  • JEP 417: Vector API (Third Incubator)
  • JEP 418: Internet-Address Resolution SPI (java.net)
  • JEP 419: Foreign Function & Memory API (Second Incubator)
  • JEP 421: Deprecate Finalization for Removal (java.lang)

JEP 417 / 419 are part of Project Panama (connecting JVM and foreign / non-Java APIs).

Tools

  • JEP 413: Code Snippets in Java API Documentation