Exploring JavaDoc Enhancements and JDK 28 Features

Última actualización: 10/27/2026
  • Introduction of the @note tag for creating visually distinct tips and warnings in API documentation.
  • Ability to create custom tag aliases and utilize advanced Doclet attributes for HTML styling.
  • Significant JVM upgrades including Generational Shenandoah GC and Ahead-of-Time compilation.
  • New language capabilities such as the Simple JSON API incubator.

Una persona planificando un proyecto de software con notas escritas a mano y código en un monitor en un espacio de trabajo moderno.

If you have been hanging around the Java ecosystem for a while, you know that the way we document our code is just as vital as the code itself. The upcoming shifts in the JDK 28 landscape are bringing some pretty neat tweaks to how we communicate with other developers, specifically through the evolution of JavaDoc. It is not just about adding more text; it is about making that text actually useful and visually distinct so that critical warnings do not get lost in a sea of paragraphs.

One of the most talked-about additions is the introduction of a specialized tag designed to make certain pieces of information pop. While the JDK 28 development cycle continues to evolve, these changes aim to streamline how APIs are presented, ensuring that the Reference Implementation of Java SE 28 (as detailed in JSR 403) provides a world-class experience for anyone diving into the source code.

Mastering the New @note Tag

Primer plano de un monitor de computadora que muestra código Java en un IDE con un bloque de comentarios JavaDoc resaltado, incluyendo etiquetas como @param y @since JDK 28.

The spotlight is currently on a proposed addition called the @note tag, which is essentially a way to shout, “Hey, look at this!” to whoever is using your API. Whether you want to provide a handy tip or a stern warning, this tag allows you to highlight content that would otherwise be buried. Depending on how you implement it, you can choose between inline notes, which feature a sleek vertical bar on the left to catch the eye, or block notes, which use an indented layout and a small header to separate the tip from the main body of text.

To keep things flexible, the Standard Doclet allows you to customize these notes using attributes. By adding name-value pairs in parentheses, you can tweak the header attribute to change the default “Note:” text to something more urgent, like “Caution:” or “Warning:”. Additionally, the kind attribute lets you inject specific CSS classes for styling, and the id attribute ensures you can link directly to a specific note within your HTML documentation.

Expanding Functionality with Custom Aliases

What is really cool is that you aren’t stuck with just the @note tag. By utilizing the javadoc -tag option, developers can create aliases. For instance, if you find yourself constantly writing warnings, you can set up a @warning tag that acts as a shortcut for @note but renders with a specific “Warning:” heading automatically. This means your source code stays clean while your generated documentation remains highly descriptive and organized.

Deep Dive into Javadoc Tooling and Options

Beyond the new tags, the javadoc tool remains a powerhouse of configuration. Most of the core options mirror those found in javac, such as –release, -encoding, and –module-path, ensuring a consistent experience across the toolchain. However, there are specific flags that are absolute lifesavers for documentation architects. For example, the -breakiterator option is a clever way to handle sentence detection across different locales, ensuring that summary tables always show the most relevant first sentence of a description.

When it comes to the output, you have an incredible amount of control. You can use -docencoding to set the HTML character set or -stylesheet to completely overhaul the visual look of your docs. For those managing massive projects, the -exclude package list and -subpackages flags allow you to surgically choose which parts of your API get documented and which stay hidden. Even the -snippet-paths option has become vital, enabling the inclusion of external code snippets that keep your documentation in sync with actual executable code via the {@snippet} tag.

The Broader JDK 28 Ecosystem

While JavaDoc is getting a facelift, the rest of JDK 28 is pushing the envelope in performance and language capabilities. We are seeing significant moves in the JVM, such as the Shenandoah GC moving to Generational Mode by default (JEP 535) and the introduction of Ahead-of-Time (AOT) code compilation (JEP 544) to slash startup times. On the language side, the Simple JSON API (JEP 540) is entering the incubator phase, which promises to make data handling much less painful for Java devs.

The road to the final release involves a rigorous process of early-access builds and community feedback, often channeled through the javadoc-dev mailing list or tracked via issues like JDK-8363700. This collaborative effort ensures that when the final version of the Java SE Platform hits the stable branch, it is polished, performant, and documented to perfection.

The combination of the versatile @note tag, advanced doclet configurations, and massive JVM enhancements like ZGC adaptive heap sizing and a new JSON API marks a significant leap forward. By integrating these documentation tools with the latest language features, developers can build APIs that are not only powerful under the hood but also crystal clear and easy to navigate for the end user.

Related posts: