JDK 20 · JSR 395

Java 20

JDK 20 is Java SE 20, JSR 395, generally available on 21 March 2023. Scoped values appear for the first time, as an incubator API. Virtual threads, record patterns, switch patterns, and the foreign function and memory API are further previews. Structured concurrency is a second incubator.

How to read the status

Language

Virtual Threads (Second Preview)

JEP 436 · Preview · Language

Virtual threads are previewed again, with a small set of changes from the first preview.

First preview in Java 19 (JEP 425). Final in Java 21 (JEP 444).

OpenJDK JEP 436 (leaves JavaMastery)

Related reading: Concurrency

APIs / Libraries

Scoped Values (Incubator)

JEP 429 · Incubator · APIs / Libraries

An incubator API shares immutable data with a call and with child threads. It is not a preview and not a standard API.

Preview in Java 21 through Java 24. Final in Java 25 (JEP 506).

OpenJDK JEP 429 (leaves JavaMastery)

Related reading: Concurrency

Structured Concurrency (Second Incubator)

JEP 437 · Incubator · APIs / Libraries

Structured concurrency incubates a second time. It is still not a preview.

First incubator in Java 19 (JEP 428). First preview in Java 21 (JEP 453).

OpenJDK JEP 437 (leaves JavaMastery)

Related reading: Concurrency

Foreign Function & Memory API (Second Preview)

JEP 434 · Preview · APIs / Libraries

The foreign function and memory API is previewed a second time.

Final in Java 22 (JEP 454).

OpenJDK JEP 434 (leaves JavaMastery)

Related reading

Historical notes

Scoped values are an incubator API in this release. There is no Java 20 sample. The incubator type lived in a module that JDK 25 does not ship, so the final Java 25 example is not a Java 20 program.

Sources. General availability, JSR 395, and the JEP list: OpenJDK JDK 20. OpenJDK JDK 20 (leaves JavaMastery)

All versions