What changed in Java 23

Markdown in Javadoc, and generational ZGC by default

A small release. The change developers notice is being able to write documentation comments in Markdown instead of HTML.

Released 2024-09 · 2 features · 3 questions · 0 scenarios

Features

Markdown documentation comments

standardJEP 467

Javadoc comments can be written in Markdown using /// line comments, instead of HTML tags inside /** */.

The problem it solved

Documentation required HTML — <p>, <ul>, <code> and escaped entities — which made comments harder to read in source than the code they described.

How you did it before

HTML inside /** */ blocks, with < and & escaped by hand and {@code} for anything containing generics.

Asked as

  • Why did Javadoc use HTML in the first place?
  • Can you mix Markdown and HTML in a doc comment?

ZGC: generational mode by default

standardJEP 474

The generational ZGC introduced in 21 became the default, with the non-generational mode deprecated and later removed in 24.

The problem it solved

Running two ZGC modes doubled the maintenance surface, and the non-generational mode was the weaker choice for almost every workload.

How you did it before

Opting into generational ZGC explicitly with -XX:+ZGenerational on 21 and 22.

Asked as

  • Which garbage collector should you use, and how would you decide?

    Other versions