Java 9 HTML5 Javadoc


Javadoc is the tool that can generate documentation for API in HTML format. In previous version of JDK, it’s HTML 4.01 – an old standard. JDK 9 Javadoc now supports to generate HTML5 markup, improves search capability and Doclint.

I. HTML5 Javadoc
1. Generating

Assume that we have 2 classes in com.javasampleapproach.html5doc package:

To generate HTML Javadoc, we run this command:

E:\Eclipse Java 9\Java9HTML5Javadoc\src is the path of src folder of our project.
E:\home\html is the foler that we wanna generate site source for Java Documentation.

Open view-source of the page, it is indicative of HTML4.01:

In JDK 9 which supports HTML5, we just need to add -html5 parameter:


This is how the site looks like:

And the source code indicates that it is in HTML5 format:

We can see structural HTML5 elements such as header, nav

2. Searching

A search box is available on the site that can be used to search for program elements, tagged words and phrases within the documentation. The search functionality is implemented locally and not rely on any server-side computational resources.

We can search for:
– declared names of modules
– packages
– types
– members

II. -Xdoclint Feature Improvements

-Xdoclint enables recommended checks for issues in Javadoc comments: bad references, lack of accessibility, missing comments, syntax error and missing HTML tags. By default, -Xdoclint is enabled. We can disable it by -Xdoclint:none.

Some ways to use -Xdoclint:

  • -Xdoclint:group: enables group
  • -Xdoclint:all: enables all
  • -Xdoclint:all,-group: enables all except group
  • group could be one or more values: accessibility, html, missing, reference, syntax.

    For example, if we create an error: @return to @retur from comment of runAPITest() method in, we can get a recommended check like this:

    By grokonez | April 5, 2017.

    Last updated on September 11, 2018.

    Related Posts

    Got Something To Say:

    Your email address will not be published. Required fields are marked *