The BackendDeeper

Kayavak / The Backend / BE·39 Modern Java Through JDK 27 / Deeper

Deeper · The Backend

Modern Java Through JDK 27

The questions the chapter doesn't stop for: why this exists, the model to keep in your head, what changes when an assumption does, how sure we are of each claim, and what's still open. Read it after the chapter; back to the chapter.

Why does this exist?

For most of its history Java shipped a big release every two to three years, and each was late: Java 7 took nearly five years (2006 to 2011) and Java 9 slipped repeatedly while the module system was finished. Features that were ready waited for features that weren't. In 2017 Oracle announced a fixed six-month cadence starting with Java 10 (March 2018): whatever is ready ships, and the rest waits six months. Long-term-support releases give organisations stable points: 11, 17, 21 and 25, now every two years.

The cadence came with a pipeline for change: features are proposed as JEPs, tried as preview or incubator features, and finalised once feedback settles them. The result is a steady modernisation (records, pattern matching, sealed types, virtual threads, faster start-up) without the big-bang releases that made upgrades frightening.

The mental model

Try it yourself first: write your own model in the Mental Model Explorer, then compare.

Modern Java moves in small, frequent, reversible steps: preview, feedback, final. Upgrade along LTS releases (or every release) and the steps stay small; skip several and they pile up.

Question Answer
What is it? Java's release process and the language and platform features it delivered since Java 8
Problem it solves Evolving a huge, conservative ecosystem without breaking it and without waiting years
Parts Six-month releases, LTS releases, JEPs, previews and incubators, deprecations and removals
How it works A feature appears as a preview (behind a flag), changes based on use, then becomes final in a later release
Assumptions Teams upgrade regularly and test previews before they finalise
When they change Staying on an old LTS for years turns each upgrade into a migration project
Where it fails Libraries and frameworks lagging behind new releases; previews that change shape between releases
Related ideas Release engineering (DevOps); dependency upgrades (ch42)

What if?

What if you used a preview feature in production?

Reason it through, then open

You'd have to run with --enable-preview, and the feature could change incompatibly or even be withdrawn in the next release (string templates were previewed in Java 21 and 22, then removed). Previews exist to collect feedback before the design is fixed. They're for experiments and early adopters who can afford to rewrite.

What if Java still shipped every three years?

Reason it through, then open

Records, pattern matching, virtual threads and switch expressions would each have waited for the slowest feature in their release, and arrived together in a large upgrade. Small releases reduce the risk of each upgrade and get feedback sooner, the same reasoning as continuous delivery for applications.

Where the boundary is

Aspect Preview feature Final feature
Enabled by --enable-preview at compile and run time Default
Can change Yes, or be removed Only through the normal deprecation process
Use in production Not advisable Yes

How sure are we?

Claim How it's known Where from
Six-month releases began with Java 10 (March 2018) Historical Oracle's announcement, 2017
LTS releases: 8, 11, 17, 21, 25 Historical Oracle and OpenJDK roadmaps
String templates were previewed and then withdrawn Historical JEPs 430 and 459, then removal in JDK 23
Regular small upgrades cost less than rare large ones Model Common experience; consistent with delivery research

Still open

Valhalla (value classes), Leyden (faster start-up by shifting work before run time) and Babylon (code reflection for GPUs and other targets) are the large projects still in progress, and their final shapes are open.

What would change your mind? If organisations that skipped LTS releases upgraded as cheaply as those that kept up, the "small steps" advice would be wrong. Experience says skipped versions accumulate breakage.

Recall

How often does Java release, and since when?

Every six months, since Java 10 in March 2018.

What is a preview feature for?

Gathering feedback before the design is final; it may change or be removed.

Which releases are LTS?

8, 11, 17, 21 and 25, now one every two years.

Why did Java move to a fixed cadence?

Ready features no longer wait for late ones, and upgrades become smaller.

Reflect

Be honest with yourself; this stays in your browser. Anything you can't tick yet is what to revisit.