18 Future Java

 

This chapter covers developments in the Java language and platform since the release of Java 17. This consists of future updates that have not yet arrived.

New directions in the Java language and platform are governed by JEPs, but those are descriptions of the implementations of specific features. At a higher level, there are several large, long-running projects within OpenJDK that are implementing the major changes that are currently in-flight and will be delivered over the coming years.

We will discuss:

  • Project Amber
  • Project Panama
  • Project Loom
  • Project Valhalla
  • Java 18

We’re going to meet each project in turn and then Java 18. We’re going to start with Project Amber, where we will hear more of the story of pattern matching and why it is such an important feature.

18.1 Project Amber

Of the current major projects in OpenJDK, Amber is the closest to completion. It also benefits from being relatively easy to understand in terms of a developer’s day-to-day work. From the project’s charter:

The goal of Project Amber is to explore and incubate smaller, productivity-oriented Java language features …

-- Project Amber https://openjdk.java.net/projects/amber/

The main goals of the project are:

  • Local Variable Type Inference (Delivered)
  • Switch Expressions (Delivered)
  • Records (Delivered)
  • Sealed Types (Delivered)
  • Pattern Matching

As you can see, a lot of these features have been delivered as of Java 17 - and very useful they are, too!

18.2 Project Panama

18.2.1 Foreign Function & Memory API

18.3 Project Loom

18.3.1 Virtual threads

18.3.2 Thread builders

18.3.3 Programming with virtual threads

18.3.4 When will Project Loom arrive?

18.4 Project Valhalla

sitemap