Java 21 (LTS)

Java 18

JEP 420: Pattern Matching for switch (Second Preview) (opens in a new tab)

Java 19

JEP 427: Pattern Matching for switch (Third Preview) (opens in a new tab)

Java 21

JEP 430: String Templates (Preview) (opens in a new tab)

JEP 431: Sequenced Collections (opens in a new tab)

JEP 439: Generational ZGC (opens in a new tab)

JEP 442: Foreign Function & Memory API (Third Preview) (opens in a new tab)

JEP 444: Virtual Threads (opens in a new tab)

  • Oracle - Java SE - 21 - Core Libraries - 14 Concurrency - Virtual Threads (opens in a new tab)

    Virtual threads can significantly improve the throughputnot the latency—of servers written in the thread-per-request style. In this style, the server dedicates a thread to processing each incoming request for its entire duration.

    • How to use

      • Write Simple, Synchronous Code Employing Blocking I/O APIs in the Thread-Per-Request Style

      • Represent Every Concurrent Task as a Virtual Thread; Never Pool Virtual Threads

      • Use Semaphores to Limit Concurrency

      • Don't Cache Expensive Reusable Objects in Thread-Local Variables

        Use Scoped Values as a modern alternative to thread-local variables.

      • Avoid Lengthy and Frequent Pinning

JEP 446: Scoped Values (Preview) (opens in a new tab)

JEP 448: Vector API (Sixth Incubator) (opens in a new tab)

JEP 452: Key Encapsulation Mechanism API (opens in a new tab)

JEP 453: Structured Concurrency (Preview) (opens in a new tab)