Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Java 9 Improved Javadoc

Java 9 Improved Javadoc

Java 9 New Features Java 9 New Features

The javadoc tool can generate Java documentation, and the output of Java 9's javadoc now conforms to the HTML5 standard.

Old-version documentation before Java 9

Consider the following file code C:/JAVA/Tester.java:

Example

/*

@author

MahKumar *

@version

0.1

*/

public

class

Tester

{

/*

@param

args command line arguments

*/

public

static

void

main

(

String

[

]

args

)

{

System

.

out

.

println

(

"

Hello World

"

)

;

}

}

Generate documentation using jdk 7's javadoc:

C:\JAVA>javadoc -d C:/JAVA Tester.java

Loading source file tester.java...

Constructing Javadoc information...

Standard Doclet version 1.7.0_21

Building tree for all the packages and classes...

Generating C:\JAVA\Tester.html...

Generating C:\JAVA\package-frame.html...

Generating C:\JAVA\package-summary.html...

Generating C:\JAVA\package-tree.html...

Generating C:\JAVA\constant-values.html...

Building index for all the packages and classes...

Generating C:\JAVA\overview-tree.html...

Generating C:\JAVA\index-all.html...

Generating C:\JAVA\deprecated-list.html...

Building index for all classes...

Generating C:\JAVA\allclasses-frame.html...

Generating C:\JAVA\allclasses-noframe.html...

Generating C:\JAVA\index.html...

Generating C:\JAVA\help-doc.html...

Executing the above command generates documentation pages under the C:/JAVA directory, as shown below:

Documentation generated by Java 9 is HTML5-compliant

Using the -html5 parameter of the jdk 9 javadoc command makes the generated documentation support the HTML5 standard:

C:\JAVA> javadoc -d C:/JAVA -html5 Tester.java

Loading source file Tester.java...

Constructing Javadoc information...

Standard Doclet version 9.0.1

Building tree for all the packages and classes...

Generating C:\JAVA\Tester.html...

Generating C:\JAVA\package-frame.html...

Generating C:\JAVA\package-summary.html...

Generating C:\JAVA\package-tree.html...

Generating C:\JAVA\constant-values.html...

Building index for all the packages and classes...

Generating C:\JAVA\overview-tree.html...

Generating C:\JAVA\index-all.html...

Generating C:\JAVA\deprecated-list.html...

Building index for all classes...

Generating C:\JAVA\allclasses-frame.html...

Generating C:\JAVA\allclasses-frame.html...

Generating C:\JAVA\allclasses-noframe.html...

Generating C:\JAVA\allclasses-noframe.html...

Generating C:\JAVA\index.html...

Generating C:\JAVA\help-doc.html...

Executing the above command generates documentation pages under the C:/JAVA directory, as shown below:

Java 9 New Features Java 9 New Features