jdk
1526 строк · 57.2 Кб
1.\" Copyright (c) 1994, 2024, Oracle and/or its affiliates. All rights reserved.
2.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
3.\"
4.\" This code is free software; you can redistribute it and/or modify it
5.\" under the terms of the GNU General Public License version 2 only, as
6.\" published by the Free Software Foundation.
7.\"
8.\" This code is distributed in the hope that it will be useful, but WITHOUT
9.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11.\" version 2 for more details (a copy is included in the LICENSE file that
12.\" accompanied this code).
13.\"
14.\" You should have received a copy of the GNU General Public License version
15.\" 2 along with this work; if not, write to the Free Software Foundation,
16.\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17.\"
18.\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
19.\" or visit www.oracle.com if you need additional information or have any
20.\" questions.
21.\"
22.\" Automatically generated by Pandoc 2.19.2
23.\"
24.\" Define V font for inline verbatim, using C font in formats
25.\" that render this, and otherwise B font.
26.ie "\f[CB]x\f[R]"x" \{\
27. ftr V B
28. ftr VI BI
29. ftr VB B
30. ftr VBI BI
31.\}
32.el \{\
33. ftr V CR
34. ftr VI CI
35. ftr VB CB
36. ftr VBI CBI
37.\}
38.TH "JAVADOC" "1" "2025" "JDK 24-ea" "JDK Commands"
39.hy
40.SH NAME
41.PP
42javadoc - generate HTML pages of API documentation from Java source
43files
44.SH SYNOPSIS
45.PP
46\f[V]javadoc\f[R] [\f[I]options\f[R]] [\f[I]packagenames\f[R]]
47[\f[I]sourcefiles\f[R]] [\f[V]\[at]\f[R]\f[I]files\f[R]]
48.TP
49\f[I]options\f[R]
50Specifies command-line options, separated by spaces.
51See \f[B]Standard \f[VB]javadoc\f[B] Options\f[R], \f[B]Extra
52\f[VB]javadoc\f[B] Options\f[R], \f[B]Standard Options for the Standard
53Doclet\f[R], and \f[B]Extra Options for the Standard Doclet\f[R].
54.TP
55\f[I]packagenames\f[R]
56Specifies names of packages that you want to document, separated by
57spaces, for example \f[V]java.lang java.lang.reflect java.awt\f[R].
58If you want to also document the subpackages, then use the
59\f[V]-subpackages\f[R] option to specify the packages.
60.RS
61.PP
62By default, \f[V]javadoc\f[R] looks for the specified packages in the
63current directory and subdirectories.
64Use the \f[V]-sourcepath\f[R] option to specify the list of directories
65where to look for packages.
66.RE
67.TP
68\f[I]sourcefiles\f[R]
69Specifies names of Java source files that you want to document,
70separated by spaces, for example
71\f[V]Class.java Object.java Button.java\f[R].
72By default, \f[V]javadoc\f[R] looks for the specified classes in the
73current directory.
74However, you can specify the full path to the class file and use
75wildcard characters, for example
76\f[V]/home/src/java/awt/Graphics*.java\f[R].
77You can also specify the path relative to the current directory.
78.TP
79\f[V]\[at]\f[R]\f[I]files\f[R]
80Specifies names of files that contain a list of \f[V]javadoc\f[R] tool
81options, package names, and source file names in any order.
82.SH DESCRIPTION
83.PP
84The \f[V]javadoc\f[R] tool parses the declarations and documentation
85comments in a set of Java source files and produces corresponding HTML
86pages that describe (by default) the public and protected classes,
87nested and implicitly declared classes (but not anonymous inner
88classes), interfaces, constructors, methods, and fields.
89You can use the \f[V]javadoc\f[R] tool to generate the API documentation
90or the implementation documentation for a set of source files.
91.PP
92You can run the \f[V]javadoc\f[R] tool on entire packages, individual
93source files, or both.
94When documenting entire packages, you can use the \f[V]-subpackages\f[R]
95option either to recursively traverse a directory and its
96subdirectories, or to pass in an explicit list of package names.
97When you document individual source files, pass in a list of Java source
98file names.
99.SS Documentation Comments
100.PP
101The \f[V]javadoc\f[R] tool uses the documentation comment, if any, that
102immediately precedes the beginning of the declaration, whether that is
103an annotation, modifier, or the name being declared.
104If there are multiple documentation comments before the declaration,
105only the last one (closest to the declaration) will be used.
106If there are any documentation comments after the beginning of the
107declaration, they will be ignored.
108To check for any extra or misplaced documentation comments, compile your
109source code with the \f[V]javac\f[R] option \f[V]-Xlint\f[R], or more
110specifically, \f[V]-Xlint:dangling-doc-comments\f[R].
111Within a source file, you may suppress any warnings generated by these
112options by using
113\f[V]\[at]SuppressWarnings(\[dq]dangling-doc-comments\[dq])\f[R] on a
114suitable enclosing declaration.
115.SS Conformance
116.PP
117The standard doclet does not validate the content of documentation
118comments for conformance, nor does it attempt to correct any errors in
119documentation comments.
120Anyone running javadoc is advised to be aware of the problems that may
121arise when generating non-conformant output or output containing
122executable content, such as JavaScript.
123The standard doclet does provide the \f[B]DocLint\f[R] feature to help
124developers detect common problems in documentation comments; but it is
125also recommended to check the generated output with any appropriate
126conformance and other checking tools.
127.PP
128For more details on the conformance requirements for HTML5 documents,
129see \f[B]Conformance requirements for authors\f[R]
130[https://html.spec.whatwg.org/multipage/introduction.html#conformance-requirements-for-authors]
131in the HTML5 Specification.
132For more details on security issues related to web pages, see the
133\f[B]Open Web Application Security Project (OWASP)\f[R]
134[https://www.owasp.org] page.
135.SH OPTIONS
136.PP
137\f[V]javadoc\f[R] supports command-line options for both the main
138\f[V]javadoc\f[R] tool and the currently selected doclet.
139The standard doclet is used if no other doclet is specified.
140.PP
141GNU-style options (that is, those beginning with \f[V]--\f[R]) can use
142an equal sign (\f[V]=\f[R]) instead of whitespace characters to separate
143the name of an option from its value.
144.SS Standard \f[V]javadoc\f[R] Options
145.PP
146The following core \f[V]javadoc\f[R] options are equivalent to
147corresponding \f[V]javac\f[R] options.
148See \f[I]Standard Options\f[R] in \f[B]javac\f[R] for the detailed
149descriptions of using these options:
150.IP \[bu] 2
151\f[V]--add-modules\f[R]
152.IP \[bu] 2
153\f[V]-bootclasspath\f[R]
154.IP \[bu] 2
155\f[V]--class-path\f[R], \f[V]-classpath\f[R], or \f[V]-cp\f[R]
156.IP \[bu] 2
157\f[V]--disable-line-doc-comments\f[R]
158.IP \[bu] 2
159\f[V]--enable-preview\f[R]
160.IP \[bu] 2
161\f[V]-encoding\f[R]
162.IP \[bu] 2
163\f[V]-extdirs\f[R]
164.IP \[bu] 2
165\f[V]--limit-modules\f[R]
166.IP \[bu] 2
167\f[V]--module\f[R]
168.IP \[bu] 2
169\f[V]--module-path\f[R] or \f[V]-p\f[R]
170.IP \[bu] 2
171\f[V]--module-source-path\f[R]
172.IP \[bu] 2
173\f[V]--release\f[R]
174.IP \[bu] 2
175\f[V]--source\f[R] or \f[V]-source\f[R]
176.IP \[bu] 2
177\f[V]--source-path\f[R] or \f[V]-sourcepath\f[R]
178.IP \[bu] 2
179\f[V]--system\f[R]
180.IP \[bu] 2
181\f[V]--upgrade-module-path\f[R]
182.PP
183The following options are the core \f[V]javadoc\f[R] options that are
184not equivalent to a corresponding \f[V]javac\f[R] option:
185.TP
186\f[V]-breakiterator\f[R]
187Computes the first sentence of the description in a documentation
188comment using an instance of \f[V]java.text.BreakIterator\f[R] to detect
189\f[I]sentence breaks\f[R].
190The rules that are used depend on the \f[B]current locale\f[R]: for
191example, for English, a sentence break occurs after a period, question
192mark, or exclamation point followed by a space when the next word starts
193with a capital letter.
194(This is meant to handle most abbreviations, such as \[dq]The serial no.
195is valid\[dq], but will not handle \[dq]Mr.
196Smith\[dq].)
197.RS
198.PP
199The option is enabled by default if the language of the current locale
200is not English.
201If the language of the current locale is English, and the
202\f[V]-breakiterator\f[R] option is not given, a simple default algorithm
203is used, which just looks for a period followed by a space.
204.PP
205In a traditional \f[V]/**...*/\f[R] comment, the search for the end of
206the first sentence is terminated by an HTML block tag, such as
207\f[V]<p>\f[R], \f[V]<pre>\f[R], or the tag for a heading.
208.PP
209In a Markdown \f[V]///\f[R] comment, the search for the end of the first
210sentence skips over any characters enclosed in code spans and links, and
211is terminated by the end of the initial block, as indicated by a blank
212line or the beginning of the next block, such as a list, thematic break,
213or an HTML block.
214.PP
215The first sentence of the description in a documentation comment is used
216in summary tables, index pages, and other situations where a short
217summary is required.
218For more explicit control in any individual documentation comment,
219enclose the contents of the first sentence in a
220\f[V]{\[at]summary ...}\f[R] tag, or when applicable, in a
221\f[V]{\[at]return ...}\f[R] tag.
222.RE
223.TP
224\f[V]-doclet\f[R] \f[I]class\f[R]
225Generates output by using an alternate doclet.
226Use the fully qualified name.
227This doclet defines the content and formats the output.
228If the \f[V]-doclet\f[R] option isn\[aq]t used, then the
229\f[V]javadoc\f[R] tool uses the standard doclet for generating the
230default HTML format.
231This class must implement the \f[V]jdk.javadoc.doclet.Doclet\f[R]
232interface.
233The path to this class is defined by the \f[V]-docletpath\f[R] option.
234.TP
235\f[V]-docletpath\f[R] \f[I]path\f[R]
236Specifies where to find doclet class files (specified with the
237\f[V]-doclet\f[R] option) and any JAR files it depends on.
238If the starting class file is in a JAR file, then this option specifies
239the path to that JAR file.
240You can specify an absolute path or a path relative to the current
241directory.
242If \f[V]path\f[R] contains multiple paths or JAR files, then they should
243be separated with a colon (\f[V]:\f[R]) on Linux and macOS, and a
244semicolon (\f[V];\f[R]) on Windows.
245This option isn\[aq]t necessary when the \f[V]doclet\f[R] starting class
246is already in the search path.
247.TP
248\f[V]-exclude\f[R] \f[I]pkglist\f[R]
249Unconditionally, excludes the specified packages and their subpackages
250from the list formed by \f[V]-subpackages\f[R].
251It excludes those packages even when they would otherwise be included by
252some earlier or later \f[V]-subpackages\f[R] option.
253.RS
254.PP
255The following example would include \f[V]java.io\f[R],
256\f[V]java.util\f[R], and \f[V]java.math\f[R] (among others), but would
257exclude packages rooted at \f[V]java.net\f[R] and \f[V]java.lang\f[R].
258Notice that these examples exclude \f[V]java.lang.ref\f[R], which is a
259subpackage of \f[V]java.lang\f[R].
260Arguments are separated by colons on all operating systems.
261.IP \[bu] 2
262\f[B]Linux and macOS:\f[R]
263.RS 2
264.IP
265.nf
266\f[CB]
267javadoc -sourcepath /home/user/src -subpackages java -exclude java.net:java.lang
268\f[R]
269.fi
270.RE
271.IP \[bu] 2
272\f[B]Windows:\f[R]
273.RS 2
274.IP
275.nf
276\f[CB]
277javadoc -sourcepath \[rs]user\[rs]src -subpackages java -exclude java.net:java.lang
278\f[R]
279.fi
280.RE
281.RE
282.TP
283\f[V]--expand-requires\f[R] (\f[V]transitive\f[R]|\f[V]all\f[R])
284Instructs the javadoc tool to expand the set of modules to be
285documented.
286By default, only the modules given explicitly on the command line are
287documented.
288Supports the following values:
289.RS
290.IP \[bu] 2
291\f[V]transitive\f[R]: additionally includes all the required transitive
292dependencies of those modules.
293.IP \[bu] 2
294\f[V]all\f[R]: includes all dependencies.
295.RE
296.TP
297\f[V]--help\f[R], \f[V]-help\f[R], \f[V]-h\f[R], or \f[V]-?\f[R]
298Prints a synopsis of the standard options.
299.TP
300\f[V]--help-extra\f[R] or \f[V]-X\f[R]
301Prints a synopsis of the set of extra options.
302.TP
303\f[V]-J\f[R]\f[I]flag\f[R]
304Passes \f[I]flag\f[R] directly to the Java Runtime Environment (JRE)
305that runs the \f[V]javadoc\f[R] tool.
306For example, if you must ensure that the system sets aside 32 MB of
307memory in which to process the generated documentation, then you would
308call the \f[V]-Xmx\f[R] option as follows:
309\f[V]javadoc -J-Xmx32m -J-Xms32m com.mypackage\f[R].
310Be aware that \f[V]-Xms\f[R] is optional because it only sets the size
311of initial memory, which is useful when you know the minimum amount of
312memory required.
313.RS
314.PP
315There is no space between the \f[V]J\f[R] and the \f[V]flag\f[R].
316.PP
317Use the \f[V]-version\f[R] option to report the version of the JRE being
318used to run the \f[V]javadoc\f[R] tool.
319.IP
320.nf
321\f[CB]
322javadoc -J-version
323java version \[dq]17\[dq] 2021-09-14 LTS
324Java(TM) SE Runtime Environment (build 17+35-LTS-2724)
325Java HotSpot(TM) 64-Bit Server VM (build 17+35-LTS-2724, mixed mode, sharing)
326\f[R]
327.fi
328.RE
329.TP
330\f[V]-locale\f[R] \f[I]name\f[R]
331Specifies the locale that the \f[V]javadoc\f[R] tool uses when it
332generates documentation.
333The argument is the name of the locale, as described in
334\f[V]java.util.Locale\f[R] documentation, such as \f[V]en_US\f[R]
335(English, United States) or \f[V]en_US_WIN\f[R] (Windows variant).
336.RS
337.PP
338Specifying a locale causes the \f[V]javadoc\f[R] tool to choose the
339resource files of that locale for messages such as strings in the
340navigation bar, headings for lists and tables, help file contents,
341comments in the \f[V]stylesheet.css\f[R] file, and so on.
342It also specifies the sorting order for lists sorted alphabetically, and
343the sentence separator to determine the end of the first sentence.
344The \f[V]-locale\f[R] option doesn\[aq]t determine the locale of the
345documentation comment text specified in the source files of the
346documented classes.
347.RE
348.TP
349\f[V]-package\f[R]
350Shows only package, protected, and public classes and members.
351.TP
352\f[V]-private\f[R]
353Shows all classes and members.
354.TP
355\f[V]-protected\f[R]
356Shows only protected and public classes and members.
357This is the default.
358.TP
359\f[V]-public\f[R]
360Shows only the public classes and members.
361.TP
362\f[V]-quiet\f[R]
363Shuts off messages so that only the warnings and errors appear to make
364them easier to view.
365It also suppresses the \f[V]version\f[R] string.
366.TP
367\f[V]--show-members\f[R] \f[I]value\f[R]
368Specifies which members (fields, methods, or constructors) are
369documented, where \f[I]value\f[R] can be any of the following:
370.RS
371.IP \[bu] 2
372\f[V]public\f[R] --- shows only public members
373.IP \[bu] 2
374\f[V]protected\f[R] --- shows public and protected members; this is the
375default
376.IP \[bu] 2
377\f[V]package\f[R] --- shows public, protected, and package members
378.IP \[bu] 2
379\f[V]private\f[R] --- shows all members
380.RE
381.TP
382\f[V]--show-module-contents\f[R] \f[I]value\f[R]
383Specifies the documentation granularity of module declarations, where
384\f[I]value\f[R] can be \f[V]api\f[R] or \f[V]all\f[R].
385.TP
386\f[V]--show-packages\f[R] \f[I]value\f[R]
387Specifies which module packages are documented, where \f[I]value\f[R]
388can be \f[V]exported\f[R] or \f[V]all\f[R] packages.
389.TP
390\f[V]--show-types\f[R] \f[I]value\f[R]
391Specifies which types (classes, interfaces, etc.)
392are documented, where \f[I]value\f[R] can be any of the following:
393.RS
394.IP \[bu] 2
395\f[V]public\f[R] --- shows only public types
396.IP \[bu] 2
397\f[V]protected\f[R] --- shows public and protected types; this is the
398default
399.IP \[bu] 2
400\f[V]package\f[R] --- shows public, protected, and package types
401.IP \[bu] 2
402\f[V]private\f[R] --- shows all types
403.RE
404.TP
405\f[V]-subpackages\f[R] \f[I]subpkglist\f[R]
406Generates documentation from source files in the specified packages and
407recursively in their subpackages.
408This option is useful when adding new subpackages to the source code
409because they are automatically included.
410Each package argument is any top-level subpackage (such as
411\f[V]java\f[R]) or fully qualified package (such as
412\f[V]javax.swing\f[R]) that doesn\[aq]t need to contain source files.
413Arguments are separated by colons on all operating systems.
414Wild cards aren\[aq]t allowed.
415Use \f[V]-sourcepath\f[R] to specify where to find the packages.
416This option doesn\[aq]t process source files that are in the source tree
417but don\[aq]t belong to the packages.
418.RS
419.PP
420For example, the following commands generates documentation for packages
421named \f[V]java\f[R] and \f[V]javax.swing\f[R] and all of their
422subpackages.
423.IP \[bu] 2
424\f[B]Linux and macOS:\f[R]
425.RS 2
426.IP
427.nf
428\f[CB]
429javadoc -d docs -sourcepath /home/user/src -subpackages java:javax.swing
430\f[R]
431.fi
432.RE
433.IP \[bu] 2
434\f[B]Windows:\f[R]
435.RS 2
436.IP
437.nf
438\f[CB]
439javadoc -d docs -sourcepath \[rs]user\[rs]src -subpackages java:javax.swing
440\f[R]
441.fi
442.RE
443.RE
444.TP
445\f[V]-verbose\f[R]
446Provides more detailed messages while the \f[V]javadoc\f[R] tool runs.
447Without the \f[V]-verbose\f[R] option, messages appear for loading the
448source files, generating the documentation (one message per source
449file), and sorting.
450The \f[V]-verbose\f[R] option causes the printing of additional messages
451that specify the number of milliseconds to parse each Java source file.
452.TP
453\f[V]--version\f[R]
454Prints version information.
455.TP
456\f[V]-Werror\f[R]
457Reports an error if any warnings occur.
458.PP
459Note that if a Java source file contains an implicitly declared class,
460then that class and its public, protected, and package members will be
461documented regardless of the options such as \f[V]--show-types\f[R],
462\f[V]--show-members\f[R], \f[V]-private\f[R], \f[V]-protected\f[R],
463\f[V]-package\f[R], and \f[V]-public\f[R].
464If \f[V]--show-members\f[R] is specified with value \f[V]private\f[R] or
465if \f[V]-private\f[R] is used then all private members of an implicitly
466declared class will be documented too.
467.SS Extra \f[V]javadoc\f[R] Options
468.PP
469\f[I]Note:\f[R] The additional options for \f[V]javadoc\f[R] are subject
470to change without notice.
471.PP
472The following additional \f[V]javadoc\f[R] options are equivalent to
473corresponding \f[V]javac\f[R] options.
474See \f[I]Extra Options\f[R] in \f[B]javac\f[R] for the detailed
475descriptions of using these options:
476.IP \[bu] 2
477\f[V]--add-exports\f[R]
478.IP \[bu] 2
479\f[V]--add-reads\f[R]
480.IP \[bu] 2
481\f[V]--patch-module\f[R]
482.IP \[bu] 2
483\f[V]-Xmaxerrs\f[R]
484.IP \[bu] 2
485\f[V]-Xmaxwarns\f[R]
486.SS Standard Options for the Standard Doclet
487.PP
488The following options are provided by the standard doclet.
489.TP
490\f[V]--add-script\f[R] \f[I]file\f[R]
491Adds \f[I]file\f[R] as an additional JavaScript file to the generated
492documentation.
493This option can be used one or more times to specify additional script
494files.
495.RS
496.PP
497Command-line example:
498.RS
499.PP
500\f[V]javadoc --add-script first_script.js --add-script second_script.js pkg_foo\f[R]
501.RE
502.RE
503.TP
504\f[V]--add-stylesheet\f[R] \f[I]file\f[R]
505Adds \f[I]file\f[R] as an additional stylesheet file to the generated
506documentation.
507This option can be used one or more times to specify additional
508stylesheets included in the documentation.
509.RS
510.PP
511Command-line example:
512.IP
513.nf
514\f[CB]
515javadoc --add-stylesheet new_stylesheet_1.css --add-stylesheet new_stylesheet_2.css pkg_foo
516\f[R]
517.fi
518.RE
519.TP
520\f[V]--allow-script-in-comments\f[R]
521Allow JavaScript in documentation comments, and options whose value is
522\f[I]html-code\f[R].
523.TP
524\f[V]-author\f[R]
525Includes the text of any \f[V]author\f[R] tags in the generated
526documentation.
527.TP
528\f[V]-bottom\f[R] \f[I]html-code\f[R]
529Specifies the text to be placed at the bottom of each generated page.
530The text can contain HTML tags and white space, but when it does, the
531text must be enclosed in quotation marks.
532Use escape characters for any internal quotation marks within text.
533.TP
534\f[V]-charset\f[R] \f[I]name\f[R]
535Specifies the HTML character set for this document.
536The name should be a preferred MIME name as specified in the \f[B]IANA
537Registry, Character Sets\f[R]
538[http://www.iana.org/assignments/character-sets].
539.RS
540.PP
541For example:
542.IP
543.nf
544\f[CB]
545javadoc -charset \[dq]iso-8859-1\[dq] mypackage
546\f[R]
547.fi
548.PP
549This command inserts the following line, containing a
550\f[B]\f[VB]meta\f[B] element\f[R]
551[https://html.spec.whatwg.org/multipage/semantics.html#the-meta-element]
552in the head of every generated page:
553.IP
554.nf
555\f[CB]
556<meta http-equiv=\[dq]Content-Type\[dq] content=\[dq]text/html; charset=ISO-8859-1\[dq]>
557\f[R]
558.fi
559.RE
560.TP
561\f[V]-d\f[R] \f[I]directory\f[R]
562Specifies the destination directory where the \f[V]javadoc\f[R] tool
563saves the generated HTML files.
564If you omit the \f[V]-d\f[R] option, then the files are saved to the
565current directory.
566The \f[V]directory\f[R] value can be absolute or relative to the current
567working directory.
568The destination directory is automatically created when the
569\f[V]javadoc\f[R] tool runs.
570.RS
571.IP \[bu] 2
572\f[B]Linux and macOS:\f[R] For example, the following command generates
573the documentation for the package \f[V]com.mypackage\f[R] and saves the
574results in the \f[V]/user/doc/\f[R] directory:
575.RS 2
576.IP
577.nf
578\f[CB]
579javadoc -d /user/doc/ com.mypackage
580\f[R]
581.fi
582.RE
583.IP \[bu] 2
584\f[B]Windows:\f[R] For example, the following command generates the
585documentation for the package \f[V]com.mypackage\f[R] and saves the
586results in the \f[V]\[rs]user\[rs]doc\[rs]\f[R] directory:
587.RS 2
588.IP
589.nf
590\f[CB]
591javadoc -d \[rs]user\[rs]doc\[rs] com.mypackage
592\f[R]
593.fi
594.RE
595.RE
596.TP
597\f[V]-docencoding\f[R] \f[I]name\f[R]
598Specifies the encoding of the generated HTML files.
599The name should be a preferred MIME name as specified in the \f[B]IANA
600Registry, Character Sets\f[R]
601[http://www.iana.org/assignments/character-sets].
602.RS
603.PP
604Three options are available for use in a \f[V]javadoc\f[R] encoding
605command.
606The \f[V]-encoding\f[R] option is used for encoding the files read by
607the \f[V]javadoc\f[R] tool, while the \f[V]-docencoding\f[R] and
608\f[V]-charset\f[R] options are used for encoding the files written by
609the tool.
610Of the three available options, at most, only the input and an output
611encoding option are used in a single encoding command.
612If you specify both input and output encoding options in a command, they
613must be the same value.
614If you specify neither output option, it defaults to the input encoding.
615.PP
616For example:
617.IP
618.nf
619\f[CB]
620javadoc -docencoding \[dq]iso-8859-1\[dq] mypackage
621\f[R]
622.fi
623.RE
624.TP
625\f[V]-docfilessubdirs\f[R]
626Enables deep copying of \f[V]doc-files\f[R] directories.
627Subdirectories and all contents are recursively copied to the
628destination.
629For example, the directory \f[V]doc-files/example/images\f[R] and all of
630its contents are copied.
631Use the \f[B]\f[VB]-excludedocfilessubdir\f[B]\f[R] option to restrict
632the subdirectories to be copied.
633.TP
634\f[V]-doctitle\f[R] \f[I]html-code\f[R]
635Specifies the title to place near the top of the overview summary file.
636The text specified in the \f[V]title\f[R] tag is placed as a centered,
637level-one heading directly beneath the navigation bar.
638The \f[V]title\f[R] tag can contain HTML tags and white space, but when
639it does, you must enclose the title in quotation marks.
640Additional quotation marks within the \f[V]title\f[R] tag must be
641escaped.
642For example,
643\f[V]javadoc -doctitle \[dq]<b>My Library</b><br>v1.0\[dq] com.mypackage\f[R].
644.TP
645\f[V]-excludedocfilessubdir\f[R] \f[I]name1\f[R]\f[V],\f[R]\f[I]name2...\f[R]
646Excludes any subdirectories with the given names when recursively
647copying \f[V]doc-files\f[R] subdirectories.
648See \f[B]\f[VB]-docfilessubdirs\f[B]\f[R].
649For historical reasons, \f[V]:\f[R] can be used anywhere in the argument
650as a separator instead of \f[V],\f[R].
651.TP
652\f[V]-footer\f[R] \f[I]html-code\f[R]
653This option is no longer supported and reports a warning.
654.TP
655\f[V]-group\f[R] \f[I]name\f[R] \f[I]p1\f[R]\f[V],\f[R]\f[I]p2...\f[R]
656Group the specified packages together in the Overview page.
657For historical reasons, \f[V]:\f[R] can be used as a separator anywhere
658in the argument instead of \f[V],\f[R].
659.TP
660\f[V]-header\f[R] \f[I]html-code\f[R]
661Specifies the header text to be placed at the top of each output file.
662The header is placed to the right of the navigation bar.
663The \f[V]header\f[R] can contain HTML tags and white space, but when it
664does, the \f[V]header\f[R] must be enclosed in quotation marks.
665Use escape characters for internal quotation marks within a header.
666For example,
667\f[V]javadoc -header \[dq]<b>My Library</b><br>v1.0\[dq] com.mypackage\f[R].
668.TP
669\f[V]-helpfile\f[R] \f[I]filename\f[R]
670Specifies a file containing the text that will be displayed when the
671\f[B]HELP\f[R] link in the navigation bar is clicked.
672If this option is not given, the \f[V]javadoc\f[R] tool creates a
673default page that will be used.
674.TP
675\f[V]-html5\f[R]
676This option is a no-op and is just retained for backwards compatibility.
677.TP
678\f[V]--javafx\f[R] or \f[V]-javafx\f[R]
679Enables JavaFX functionality.
680This option is enabled by default if the JavaFX library classes are
681detected on the module path.
682.TP
683\f[V]-keywords\f[R]
684Adds HTML keyword \f[V]<meta>\f[R] tags to the generated file for each
685class.
686These tags can help search engines that look for \f[V]<meta>\f[R] tags
687find the pages.
688Most search engines that search the entire Internet don\[aq]t look at
689\f[V]<meta>\f[R] tags, because pages can misuse them.
690Search engines offered by companies that confine their searches to their
691own website can benefit by looking at \f[V]<meta>\f[R] tags.
692The \f[V]<meta>\f[R] tags include the fully qualified name of the class
693and the unqualified names of the fields and methods.
694Constructors aren\[aq]t included because they are identical to the class
695name.
696For example, the page for the class \f[V]String\f[R] includes these
697keywords:
698.RS
699.IP
700.nf
701\f[CB]
702<meta name=\[dq]keywords\[dq] content=\[dq]java.lang.String class\[dq]>
703<meta name=\[dq]keywords\[dq] content=\[dq]CASE_INSENSITIVE_ORDER\[dq]>
704<meta name=\[dq]keywords\[dq] content=\[dq]length()\[dq]>
705<meta name=\[dq]keywords\[dq] content=\[dq]isEmpty()\[dq]>
706\f[R]
707.fi
708.RE
709.TP
710\f[V]-link\f[R] \f[I]url\f[R]
711Creates links to existing \f[V]javadoc\f[R] generated documentation of
712externally referenced classes.
713The \f[I]url\f[R] argument is the absolute or relative URL of the
714directory that contains the external \f[V]javadoc\f[R] generated
715documentation.
716You can specify multiple \f[V]-link\f[R] options in a specified
717\f[V]javadoc\f[R] tool run to link to multiple documents.
718.RS
719.PP
720Either a \f[V]package-list\f[R] or an \f[V]element-list\f[R] file must
721be in this \f[I]url\f[R] directory (otherwise, use the
722\f[V]-linkoffline\f[R] option).
723.PP
724\f[I]Note:\f[R] The \f[V]package-list\f[R] and \f[V]element-list\f[R]
725files are generated by the \f[V]javadoc\f[R] tool when generating the
726API documentation and should not be modified by the user.
727.PP
728When you use the \f[V]javadoc\f[R] tool to document packages, it uses
729the \f[V]package-list\f[R] file to determine the packages declared in an
730API.
731When you generate API documents for modules, the \f[V]javadoc\f[R] tool
732uses the \f[V]element-list\f[R] file to determine the modules and
733packages declared in an API.
734.PP
735The \f[V]javadoc\f[R] tool reads the names from the appropriate list
736file and then links to the packages or modules at that URL.
737.PP
738When the \f[V]javadoc\f[R] tool runs, the \f[I]url\f[R] value is copied
739into the \f[V]<a href>\f[R] links that are created.
740Therefore, \f[I]url\f[R] must be the URL to the directory and not to a
741file.
742.PP
743You can use an absolute link for \f[I]url\f[R] to enable your documents
744to link to a document on any web site, or you can use a relative link to
745link only to a relative location.
746If you use a relative link, then the value you pass in should be the
747relative path from the destination directory (specified with the
748\f[V]-d\f[R] option) to the directory containing the packages being
749linked to.
750When you specify an absolute link, you usually use an HTTP link.
751However, if you want to link to a file system that has no web server,
752then you can use a file link.
753Use a file link only when everyone who wants to access the generated
754documentation shares the same file system.
755In all cases, and on all operating systems, use a slash as the
756separator, whether the URL is absolute or relative, and
757\f[V]https:\f[R], \f[V]http:\f[R], or \f[V]file:\f[R] as specified in
758the \f[B]RFC 1738: Uniform Resource Locators (URL)\f[R]
759[https://www.rfc-editor.org/info/rfc1738].
760.IP
761.nf
762\f[CB]
763-link https://<host>/<directory>/<directory>/.../<name>
764-link http://<host>/<directory>/<directory>/.../<name>
765-link file://<host>/<directory>/<directory>/.../<name>
766-link <directory>/<directory>/.../<name>
767\f[R]
768.fi
769.RE
770.TP
771\f[V]--link-modularity-mismatch\f[R] (\f[V]warn\f[R]|\f[V]info\f[R])
772Specifies whether external documentation with wrong modularity (e.g.
773non-modular documentation for a modular library, or the reverse case)
774should be reported as a warning (\f[V]warn\f[R]) or just a message
775(\f[V]info\f[R]).
776The default behavior is to report a warning.
777.TP
778\f[V]-linkoffline\f[R] \f[I]url1\f[R] \f[I]url2\f[R]
779This option is a variation of the \f[V]-link\f[R] option.
780They both create links to \f[V]javadoc\f[R] generated documentation for
781externally referenced classes.
782You can specify multiple \f[V]-linkoffline\f[R] options in a specified
783\f[V]javadoc\f[R] tool run.
784.RS
785.PP
786Use the \f[V]-linkoffline\f[R] option when:
787.IP \[bu] 2
788Linking to a document on the web that the \f[V]javadoc\f[R] tool
789can\[aq]t access through a web connection
790.IP \[bu] 2
791The \f[V]package-list\f[R] or \f[V]element-list\f[R] file of the
792external document either isn\[aq]t accessible or doesn\[aq]t exist at
793the URL location, but does exist at a different location and can be
794specified by either the \f[V]package-list\f[R] or \f[V]element-list\f[R]
795file (typically local).
796.PP
797\f[I]Note:\f[R] The \f[V]package-list\f[R] and \f[V]element-list\f[R]
798files are generated by the \f[V]javadoc\f[R] tool when generating the
799API documentation and should not be modified by the user.
800.PP
801If \f[I]url1\f[R] is accessible only on the World Wide Web, then the
802\f[V]-linkoffline\f[R] option removes the constraint that the
803\f[V]javadoc\f[R] tool must have a web connection to generate
804documentation.
805.PP
806Another use of the \f[V]-linkoffline\f[R] option is as a work-around to
807update documents.
808After you have run the \f[V]javadoc\f[R] tool on a full set of packages
809or modules, you can run the \f[V]javadoc\f[R] tool again on a smaller
810set of changed packages or modules, so that the updated files can be
811inserted back into the original set.
812.PP
813For example, the \f[V]-linkoffline\f[R] option takes two arguments.
814The first is for the string to be embedded in the \f[V]<a href>\f[R]
815links, and the second tells the \f[V]javadoc\f[R] tool where to find
816either the \f[V]package-list\f[R] or \f[V]element-list\f[R] file.
817.PP
818The \f[I]url1\f[R] or \f[I]url2\f[R] value is the absolute or relative
819URL of the directory that contains the external \f[V]javadoc\f[R]
820generated documentation that you want to link to.
821When relative, the value should be the relative path from the
822destination directory (specified with the \f[V]-d\f[R] option) to the
823root of the packages being linked to.
824See \f[I]url\f[R] in the \f[V]-link\f[R] option.
825.RE
826.TP
827\f[V]--link-platform-properties\f[R] \f[I]url\f[R]
828Specifies a properties file used to configure links to platform
829documentation.
830.RS
831.PP
832The \f[I]url\f[R] argument is expected to point to a properties file
833containing one or more entries with the following format, where
834\f[V]<version>\f[R] is the platform version as passed to the
835\f[V]--release\f[R] or \f[V]--source\f[R] option and \f[V]<url>\f[R] is
836the base URL of the corresponding platform API documentation:
837.IP
838.nf
839\f[CB]
840doclet.platform.docs.<version>=<url>
841\f[R]
842.fi
843.PP
844For instance, a properties file containing URLs for releases 15 to 17
845might contain the following lines:
846.IP
847.nf
848\f[CB]
849doclet.platform.docs.15=https://example.com/api/15/
850doclet.platform.docs.16=https://example.com/api/16/
851doclet.platform.docs.17=https://example.com/api/17/
852\f[R]
853.fi
854.PP
855If the properties file does not contain an entry for a particular
856release no platform links are generated.
857.RE
858.TP
859\f[V]-linksource\f[R]
860Creates an HTML version of each source file (with line numbers) and adds
861links to them from the standard HTML documentation.
862Links are created for classes, interfaces, constructors, methods, and
863fields whose declarations are in a source file.
864Otherwise, links aren\[aq]t created, such as for default constructors
865and generated classes.
866.RS
867.PP
868This option exposes all private implementation details in the included
869source files, including private classes, private fields, and the bodies
870of private methods, regardless of the \f[V]-public\f[R],
871\f[V]-package\f[R], \f[V]-protected\f[R], and \f[V]-private\f[R]
872options.
873Unless you also use the \f[V]-private\f[R] option, not all private
874classes or interfaces are accessible through links.
875.PP
876Each link appears on the name of the identifier in its declaration.
877For example, the link to the source code of the \f[V]Button\f[R] class
878would be on the word \f[V]Button\f[R]:
879.IP
880.nf
881\f[CB]
882public class Button extends Component implements Accessible
883\f[R]
884.fi
885.PP
886The link to the source code of the \f[V]getLabel\f[R] method in the
887\f[V]Button\f[R] class is on the word \f[V]getLabel\f[R]:
888.IP
889.nf
890\f[CB]
891public String getLabel()
892\f[R]
893.fi
894.RE
895.TP
896\f[V]--main-stylesheet\f[R] \f[I]file\f[R] or \f[V]-stylesheetfile\f[R] \f[I]file\f[R]
897Specifies the path of an alternate stylesheet file that contains the
898definitions for the CSS styles used in the generated documentation.
899This option lets you override the default.
900If you do not specify the option, the \f[V]javadoc\f[R] tool will create
901and use a default stylesheet.
902The file name can be any name and isn\[aq]t restricted to
903\f[V]stylesheet.css\f[R].
904The \f[V]--main-stylesheet\f[R] option is the preferred form.
905.RS
906.PP
907Command-line example:
908.IP
909.nf
910\f[CB]
911javadoc --main-stylesheet main_stylesheet.css pkg_foo
912\f[R]
913.fi
914.RE
915.TP
916\f[V]-nocomment\f[R]
917Suppresses the entire comment body, including the main description and
918all tags, and generate only declarations.
919This option lets you reuse source files that were originally intended
920for a different purpose so that you can produce skeleton HTML
921documentation during the early stages of a new project.
922.TP
923\f[V]-nodeprecated\f[R]
924Prevents the generation of any deprecated API in the documentation.
925This does what the \f[V]-nodeprecatedlist\f[R] option does, and it
926doesn\[aq]t generate any deprecated API throughout the rest of the
927documentation.
928This is useful when writing code when you don\[aq]t want to be
929distracted by the deprecated code.
930.TP
931\f[V]-nodeprecatedlist\f[R]
932Prevents the generation of the file that contains the list of deprecated
933APIs (\f[V]deprecated-list.html\f[R]) and the link in the navigation bar
934to that page.
935The \f[V]javadoc\f[R] tool continues to generate the deprecated API
936throughout the rest of the document.
937This is useful when your source code contains no deprecated APIs, and
938you want to make the navigation bar cleaner.
939.TP
940\f[V]--no-fonts\f[R]
941Prevents inclusion of font files in the generated documentation.
942This can be useful if the documentation uses a custom stylesheet which
943does not use the default fonts.
944.TP
945\f[V]-nohelp\f[R]
946Omits the \f[B]HELP\f[R] link in the navigation bar at the top of each
947generated page.
948.TP
949\f[V]-noindex\f[R]
950Omits the index from the generated documents.
951The index is produced by default.
952.TP
953\f[V]-nonavbar\f[R]
954Prevents the generation of the navigation bar and header.
955The \f[V]-nonavbar\f[R] option has no effect on the \f[V]-bottom\f[R]
956option.
957The \f[V]-nonavbar\f[R] option is useful when you are interested only in
958the content and have no need for navigation, such as when you are
959converting the files to PostScript or PDF for printing only.
960.TP
961\f[V]--no-platform-links\f[R]
962Prevents the generation of links to platform documentation.
963These links are generated by default.
964.TP
965\f[V]-noqualifier\f[R] \f[I]name1\f[R]\f[V],\f[R]\f[I]name2...\f[R]
966Excludes the list of qualifiers from the output.
967The package name is removed from places where class or interface names
968appear.
969For historical reasons, \f[V]:\f[R] can be used anywhere in the argument
970as a separator instead of \f[V],\f[R].
971.RS
972.PP
973The following example omits all package qualifiers:
974\f[V]-noqualifier all\f[R].
975.PP
976The following example omits \f[V]java.lang\f[R] and \f[V]java.io\f[R]
977package qualifiers: \f[V]-noqualifier java.lang:java.io\f[R].
978.PP
979The following example omits package qualifiers starting with
980\f[V]java\f[R] and \f[V]com.sun\f[R] subpackages, but not
981\f[V]javax: -noqualifier java.*:com.sun.*\f[R].
982.PP
983Where a package qualifier would appear due to the previous behavior, the
984name can be suitably shortened.
985This rule is in effect whether or not the \f[V]-noqualifier\f[R] option
986is used.
987.RE
988.TP
989\f[V]-nosince\f[R]
990Omits from the generated documentation the \f[V]Since\f[R] sections
991derived from any \f[V]since\f[R] tags.
992.TP
993\f[V]-notimestamp\f[R]
994Suppresses the time stamp, which is hidden in an HTML comment in the
995generated HTML near the top of each page.
996The \f[V]-notimestamp\f[R] option is useful when you want to run the
997\f[V]javadoc\f[R] tool on two source bases and compare them, because it
998prevents time stamps from causing a difference (which would otherwise be
999a difference on every page).
1000The time stamp includes the \f[V]javadoc\f[R] tool release number.
1001.TP
1002\f[V]-notree\f[R]
1003Omits the class and interface hierarchy pages from the generated
1004documents.
1005These are the pages you reach using the \f[B]TREE\f[R] link in the
1006navigation bar.
1007The hierarchy is produced by default.
1008.TP
1009\f[V]--override-methods\f[R] (\f[V]detail\f[R]|\f[V]summary\f[R])
1010Documents overridden methods in the detail or summary sections.
1011The default is \f[V]detail\f[R].
1012.TP
1013\f[V]-overview\f[R] \f[I]filename\f[R]
1014Specifies that the \f[V]javadoc\f[R] tool should retrieve the content
1015for the overview documentation from the file specified by
1016\f[I]filename\f[R] and place it on the Overview page
1017(\f[V]overview-summary.html\f[R]).
1018If the \f[I]filename\f[R] is a relative path, it is evaluated relative
1019to the current working directory.
1020.RS
1021.PP
1022The file may be an HTML file, with a filename ending in \f[V].html\f[R],
1023or a Markdown file, with a filename ending in \f[V].md\f[R].
1024If the file is an HTML file, the content for the overview documentation
1025is taken from the \f[V]<main>\f[R] element in the file, if one is
1026present, or from the \f[V]<body>\f[R] element is there is no
1027\f[V]<main>\f[R] element.
1028If the file is a Markdown file, the entire content of the file is used.
1029.PP
1030The title on the overview page is set by \f[V]-doctitle\f[R].
1031.PP
1032\f[I]Note:\f[R] older versions of the \f[V]javadoc\f[R] tool assumed
1033that any use of this option was for an HTML file, and allowed any
1034extension for the \f[I]filename\f[R].
1035.RE
1036.TP
1037\f[V]-serialwarn\f[R]
1038Reports compile-time warnings for missing \f[V]\[at]serial\f[R] tags.
1039By default, Javadoc reports no serial warnings.
1040Use this option to display the serial warnings, which helps to properly
1041document default serializable fields and \f[V]writeExternal\f[R]
1042methods.
1043.TP
1044\f[V]--since\f[R] \f[I]release\f[R](\f[V],\f[R]\f[I]release\f[R])*
1045Generates documentation for APIs that were added or newly deprecated in
1046the specified \f[I]release\f[R]s.
1047.RS
1048.PP
1049If the \f[V]\[at]since\f[R] tag in the \f[V]javadoc\f[R] comment of an
1050element in the documented source code matches a \f[I]release\f[R] passed
1051as the option argument, information about the element and the release it
1052was added in is included in a \[dq]New API\[dq] page.
1053.PP
1054If the \[dq]Deprecated API\[dq] page is generated and the
1055\f[V]since\f[R] element of the \f[V]java.lang.Deprecated\f[R] annotation
1056of a documented element matches a \f[I]release\f[R] in the option
1057arguments, information about the release the element was deprecated in
1058is added to the \[dq]Deprecated API\[dq] page.
1059.PP
1060Releases are compared using case-sensitive string comparison.
1061.RE
1062.TP
1063\f[V]--since-label\f[R] \f[I]text\f[R]
1064Specifies the \f[I]text\f[R] to use in the heading of the \[dq]New
1065API\[dq] page.
1066This may contain information about the releases covered in the page,
1067e.g.
1068\[dq]New API in release 2.0\[dq], or \[dq]New API since release 1\[dq].
1069.TP
1070\f[V]--snippet-path\f[R] \f[I]snippetpathlist\f[R]
1071Specifies the search paths for finding files for external snippets.
1072The \f[I]snippetpathlist\f[R] can contain multiple paths by separating
1073them with the platform path separator (\f[V];\f[R] on Windows;
1074\f[V]:\f[R] on other platforms.)
1075The standard doclet first searches the \f[V]snippet-files\f[R]
1076subdirectory in the package containing the snippet, and then searches
1077all the directories in the given list.
1078.TP
1079\f[V]-sourcetab\f[R] \f[I]tab-length\f[R]
1080Specifies the number of spaces each tab uses in the source.
1081.TP
1082\f[V]--spec-base-url\f[R] \f[I]url\f[R]
1083Specifies the base URL for relative URLs in \f[V]\[at]spec\f[R] tags, to
1084be used when generating links to any external specifications.
1085It can either be an absolute URL, or a relative URL, in which case it is
1086evaluated relative to the base directory of the generated output files.
1087The default value is equivalent to \f[V]{\[at]docRoot}/../specs\f[R].
1088.TP
1089\f[V]-splitindex\f[R]
1090Splits the index file into multiple files, alphabetically, one file per
1091letter, plus a file for any index entries that start with
1092non-alphabetical symbols.
1093.TP
1094\f[V]-tag\f[R] \f[I]name\f[R]:\f[I]locations\f[R]:\f[I]header\f[R]
1095Specifies a custom tag with a single argument.
1096For the \f[V]javadoc\f[R] tool to spell-check tag names, it is important
1097to include a \f[V]-tag\f[R] option for every custom tag that is present
1098in the source code, disabling (with \f[V]X\f[R]) those that aren\[aq]t
1099being output in the current run.
1100The colon (\f[V]:\f[R]) is always the separator.
1101To include a colon in the tag name, escape it with a backward slash
1102(\f[V]\[rs]\f[R]).
1103The \f[V]-tag\f[R] option outputs the tag heading, \f[I]header\f[R], in
1104bold, followed on the next line by the text from its single argument.
1105Similar to any block tag, the argument text can contain inline tags,
1106which are also interpreted.
1107The output is similar to standard one-argument tags, such as the
1108\f[V]\[at]return\f[R] and \f[V]\[at]author\f[R] tags.
1109Omitting a \f[I]header\f[R] value causes the \f[I]name\f[R] to be the
1110heading.
1111\f[I]locations\f[R] is a list of characters specifying the kinds of
1112declarations in which the tag may be used.
1113The following characters may be used, in either uppercase or lowercase:
1114.RS
1115.IP \[bu] 2
1116\f[V]A\f[R]: all declarations
1117.IP \[bu] 2
1118\f[V]C\f[R]: constructors
1119.IP \[bu] 2
1120\f[V]F\f[R]: fields
1121.IP \[bu] 2
1122\f[V]M\f[R]: methods
1123.IP \[bu] 2
1124\f[V]O\f[R]: the overview page and other documentation files in
1125\f[V]doc-files\f[R] subdirectories
1126.IP \[bu] 2
1127\f[V]P\f[R]: packages
1128.IP \[bu] 2
1129\f[V]S\f[R]: modules
1130.IP \[bu] 2
1131\f[V]T\f[R]: types (classes and interfaces)
1132.IP \[bu] 2
1133\f[V]X\f[R]: nowhere: the tag is disabled, and will be ignored
1134.PP
1135The order in which tags are given on the command line will be used as
1136the order in which the tags appear in the generated output.
1137You can include standard tags in the order given on the command line by
1138using the \f[V]-tag\f[R] option with no \f[I]locations\f[R] or
1139\f[I]header\f[R].
1140.RE
1141.TP
1142\f[V]-taglet\f[R] \f[I]class\f[R]
1143Specifies the fully qualified name of the taglet used in generating the
1144documentation for that tag.
1145Use the fully qualified name for the \f[I]class\f[R] value.
1146This taglet also defines the number of text arguments that the custom
1147tag has.
1148The taglet accepts those arguments, processes them, and generates the
1149output.
1150.RS
1151.PP
1152Taglets are useful for block or inline tags.
1153They can have any number of arguments and implement custom behavior,
1154such as making text bold, formatting bullets, writing out the text to a
1155file, or starting other processes.
1156Taglets can only determine where a tag should appear and in what form.
1157All other decisions are made by the doclet.
1158A taglet can\[aq]t do things such as remove a class name from the list
1159of included classes.
1160However, it can execute side effects, such as printing the tag\[aq]s
1161text to a file or triggering another process.
1162Use the \f[V]-tagletpath\f[R] option to specify the path to the taglet.
1163The following example inserts the To Do taglet after Parameters and
1164ahead of Throws in the generated pages.
1165.IP
1166.nf
1167\f[CB]
1168-taglet com.sun.tools.doclets.ToDoTaglet
1169-tagletpath /home/taglets
1170-tag return
1171-tag param
1172-tag todo
1173-tag throws
1174-tag see
1175\f[R]
1176.fi
1177.PP
1178Alternately, you can use the \f[V]-taglet\f[R] option in place of its
1179\f[V]-tag\f[R] option, but that might be difficult to read.
1180.RE
1181.TP
1182\f[V]-tagletpath\f[R] \f[I]tagletpathlist\f[R]
1183Specifies the search paths for finding taglet class files.
1184The \f[I]tagletpathlist\f[R] can contain multiple paths by separating
1185them with the platform path separator (\f[V];\f[R] on Windows;
1186\f[V]:\f[R] on other platforms.)
1187The \f[V]javadoc\f[R] tool searches all subdirectories of the specified
1188paths.
1189.TP
1190\f[V]-top\f[R] \f[I]html-code\f[R]
1191Specifies the text to be placed at the top of each output file.
1192.TP
1193\f[V]-use\f[R]
1194Creates class and package usage pages.
1195Includes one Use page for each documented class and package.
1196The page describes what packages, classes, methods, constructors, and
1197fields use any API of the specified class or package.
1198Given class C, things that use class C would include subclasses of C,
1199fields declared as C, methods that return C, and methods and
1200constructors with parameters of type C.
1201For example, you can look at the Use page for the \f[V]String\f[R] type.
1202Because the \f[V]getName\f[R] method in the \f[V]java.awt.Font\f[R]
1203class returns type \f[V]String\f[R], the \f[V]getName\f[R] method uses
1204\f[V]String\f[R] and so the \f[V]getName\f[R] method appears on the Use
1205page for \f[V]String\f[R].
1206This documents only uses of the API, not the implementation.
1207When a method uses \f[V]String\f[R] in its implementation, but
1208doesn\[aq]t take a string as an argument or return a string, that
1209isn\[aq]t considered a use of \f[V]String\f[R].
1210To access the generated Use page, go to the class or package and click
1211the \f[B]USE\f[R] link in the navigation bar.
1212.TP
1213\f[V]-version\f[R]
1214Includes the text of any \f[V]version\f[R] tags in the generated
1215documentation.
1216This text is omitted by default.
1217Note: To find out what version of the \f[V]javadoc\f[R] tool you are
1218using, use the \f[V]--version\f[R] option (with two hyphens).
1219.TP
1220\f[V]-windowtitle\f[R] \f[I]title\f[R]
1221Specifies the title to be placed in the HTML \f[V]<title>\f[R] tag.
1222The text specified in the \f[V]title\f[R] tag appears in the window
1223title and in any browser bookmarks (favorite places) that someone
1224creates for this page.
1225This title should not contain any HTML tags because a browser will not
1226interpret them correctly.
1227Use escape characters on any internal quotation marks within the
1228\f[V]title\f[R] tag.
1229If the \f[V]-windowtitle\f[R] option is omitted, then the
1230\f[V]javadoc\f[R] tool uses the value of the \f[V]-doctitle\f[R] option
1231for the \f[V]-windowtitle\f[R] option.
1232For example,
1233\f[V]javadoc -windowtitle \[dq]My Library\[dq] com.mypackage\f[R].
1234.SS Extra Options for the Standard Doclet
1235.PP
1236The following are additional options provided by the standard doclet and
1237are subject to change without notice.
1238Additional options are less commonly used or are otherwise regarded as
1239advanced.
1240.TP
1241\f[V]--date\f[R] \f[I]date-and-time\f[R]
1242Specifies the value to be used to timestamp the generated pages, in
1243\f[B]ISO 8601\f[R]
1244[https://www.iso.org/iso-8601-date-and-time-format.html] format.
1245The specified value must be within 10 years of the current date and
1246time.
1247It is an error to specify both \f[V]-notimestamp\f[R] and
1248\f[V]--date\f[R].
1249Using a specific value means the generated documentation can be part of
1250a \f[B]reproducible build\f[R] [https://reproducible-builds.org/].
1251If the option is not given, the default value is the current date and
1252time.
1253For example:
1254.RS
1255.IP
1256.nf
1257\f[CB]
1258javadoc --date 2022-02-01T17:41:59-08:00 mypackage
1259\f[R]
1260.fi
1261.RE
1262.TP
1263\f[V]--legal-notices\f[R] (\f[V]default\f[R]|\f[V]none\f[R]|\f[I]directory\f[R])
1264Specifies the location from which to copy legal files to the generated
1265documentation.
1266If the option is not specified or is used with the value
1267\f[V]default\f[R], the files are copied from the default location.
1268If the argument is used with value \f[V]none\f[R], no files are copied.
1269Every other argument is interpreted as directory from which to copy the
1270legal files.
1271.TP
1272\f[V]--no-frames\f[R]
1273This option is no longer supported and reports a warning.
1274.TP
1275\f[V]-Xdoclint\f[R]
1276Enables recommended checks for problems in documentation comments.
1277.RS
1278.PP
1279By default, the \f[V]-Xdoclint\f[R] option is enabled.
1280Disable it with the option \f[V]-Xdoclint:none\f[R].
1281.PP
1282For more details, see \f[B]DocLint\f[R].
1283.RE
1284.TP
1285\f[V]-Xdoclint:\f[R]\f[I]flag\f[R],\f[I]flag\f[R],...
1286Enables or disables specific checks for different kinds of issues in
1287documentation comments.
1288.RS
1289.PP
1290Each \f[I]flag\f[R] can be one of \f[V]all\f[R], \f[V]none\f[R], or
1291\f[V][-]\f[R]\f[I]group\f[R] where \f[I]group\f[R] has one of the
1292following values: \f[V]accessibility\f[R], \f[V]html\f[R],
1293\f[V]missing\f[R], \f[V]reference\f[R], \f[V]syntax\f[R].
1294For more details on these values, see \f[B]DocLint Groups\f[R].
1295.PP
1296When specifying two or more flags, you can either use a single
1297\f[V]-Xdoclint:...\f[R] option, listing all the desired flags, or you
1298can use multiple options giving one or more flag in each option.
1299For example, use either of the following commands to check for the HTML,
1300syntax, and accessibility issues in the file \f[V]MyFile.java\f[R].
1301.IP
1302.nf
1303\f[CB]
1304javadoc -Xdoclint:html -Xdoclint:syntax -Xdoclint:accessibility MyFile.java
1305javadoc -Xdoclint:html,syntax,accessibility MyFile.java
1306\f[R]
1307.fi
1308.PP
1309The following examples illustrate how to change what DocLint reports:
1310.IP \[bu] 2
1311\f[V]-Xdoclint:none\f[R] --- disables all checks
1312.IP \[bu] 2
1313\f[V]-Xdoclint:\f[R]\f[I]group\f[R] --- enables \f[I]group\f[R] checks
1314.IP \[bu] 2
1315\f[V]-Xdoclint:all\f[R] --- enables all groups of checks
1316.IP \[bu] 2
1317\f[V]-Xdoclint:all,-\f[R]\f[I]group\f[R] --- enables all checks except
1318\f[I]group\f[R] checks
1319.PP
1320For more details, see \f[B]DocLint\f[R].
1321.RE
1322.TP
1323\f[V]-Xdoclint/package:\f[R][\f[V]-\f[R]]\f[I]packages\f[R]
1324Enables or disables checks in specific packages.
1325\f[I]packages\f[R] is a comma separated list of package specifiers.
1326A package specifier is either a qualified name of a package or a package
1327name prefix followed by \f[V]*\f[R], which expands to all subpackages of
1328the given package.
1329Prefix the package specifier with \f[V]-\f[R] to disable checks for the
1330specified packages.
1331.RS
1332.PP
1333For more details, see \f[B]DocLint\f[R].
1334.RE
1335.TP
1336\f[V]-Xdocrootparent\f[R] \f[I]url\f[R]
1337Replaces all \f[V]\[at]docRoot\f[R] items followed by \f[V]/..\f[R] in
1338documentation comments with \f[I]url\f[R].
1339.SH DOCLINT
1340.PP
1341DocLint provides the ability to check for possible problems in
1342documentation comments.
1343Problems may be reported as warnings or errors, depending on their
1344severity.
1345For example, a missing comment may be bad style that deserves a warning,
1346but a link to an unknown Java declaration is more serious and deserves
1347an error.
1348Problems are organized into \f[B]groups\f[R], and options can be used to
1349enable or disable messages in one or more groups.
1350Within the source code, messages in one or more groups can be
1351\f[B]suppressed\f[R] by using \f[V]\[at]SuppressWarnings\f[R]
1352annotations.
1353.PP
1354When invoked from \f[V]javadoc\f[R], by default DocLint checks all
1355comments that are used in the generated documentation.
1356It thus relies on other command-line options to determine which
1357declarations, and which corresponding documentation comments will be
1358included.
1359\f[I]Note:\f[R] this may mean that even comments on some private members
1360of serializable classes will also be checked, if the members need to be
1361documented in the generated \f[V]Serialized Forms\f[R] page.
1362.PP
1363In contrast, when DocLint is invoked from \f[V]javac\f[R], DocLint
1364solely relies on the various \f[V]-Xdoclint...\f[R] options to determine
1365which documentation comments to check.
1366.PP
1367DocLint doesn\[aq]t attempt to fix invalid input, it just reports it.
1368.PP
1369\f[I]Note:\f[R] DocLint doesn\[aq]t guarantee the completeness of these
1370checks.
1371In particular, it isn\[aq]t a full HTML compliance checker.
1372The goal is to just report common errors in a convenient manner.
1373.SS Groups
1374.PP
1375The checks performed by DocLint are organized into groups.
1376The warnings and errors in each group can be enabled or disabled with
1377command-line options, or suppressed with \f[V]\[at]SuppressWarnings\f[R]
1378annotations.
1379.PP
1380The groups are as follows:
1381.IP \[bu] 2
1382\f[V]accessibility\f[R] --- Checks for issues related to accessibility.
1383For example, no \f[V]alt\f[R] attribute specified in an \f[V]<img>\f[R]
1384element, or no caption or summary attributes specified in a
1385\f[V]<table>\f[R] element.
1386.RS 2
1387.PP
1388Issues are reported as errors if a downstream validation tool might be
1389expected to report an error in the files generated by \f[V]javadoc\f[R].
1390.PP
1391For reference, see the \f[B]Web Content Accessibility Guidelines\f[R]
1392[https://www.w3.org/WAI/standards-guidelines/wcag/].
1393.RE
1394.IP \[bu] 2
1395\f[V]html\f[R] --- Detects common high-level HTML issues.
1396For example, putting block elements inside inline elements, or not
1397closing elements that require an end tag.
1398.RS 2
1399.PP
1400Issues are reported as errors if a downstream validation tool might be
1401expected to report an error in the files generated by \f[V]javadoc\f[R].
1402.PP
1403For reference, see the \f[B]HTML Living Standard\f[R]
1404[https://html.spec.whatwg.org/multipage/].
1405.RE
1406.IP \[bu] 2
1407\f[V]missing\f[R] --- Checks for missing documentation comments or tags.
1408For example, a missing comment on a class declaration, or a missing
1409\f[V]\[at]param\f[R] or \f[V]\[at]return\f[R] tag in the comment for a
1410method declaration.
1411.RS 2
1412.PP
1413Issues related to missing items are typically reported as warnings
1414because they are unlikely to be reported as errors by downstream
1415validation tools that may be used to check the output generated by
1416\f[V]javadoc\f[R].
1417.RE
1418.IP \[bu] 2
1419\f[V]reference\f[R] --- Checks for issues relating to the references to
1420Java API elements from documentation comment tags.
1421For example, the reference in \f[V]\[at]see\f[R] or
1422\f[V]{\[at]link ...}\f[R] cannot be found, or a bad name is given for
1423\f[V]\[at]param\f[R] or \f[V]\[at]throws\f[R].
1424.RS 2
1425.PP
1426Issues are typically reported as errors because while the issue may not
1427cause problems in the generated files, the author has likely made a
1428mistake that will lead to incorrect or unexpected documentation.
1429.RE
1430.IP \[bu] 2
1431\f[V]syntax\f[R] --- Checks for low-level syntactic issues in
1432documentation comments.
1433For example, unescaped angle brackets (\f[V]<\f[R] and \f[V]>\f[R]) and
1434ampersands (\f[V]&\f[R]) and invalid documentation comment tags.
1435.RS 2
1436.PP
1437Issues are typically reported as errors because the issues may lead to
1438incorrect or unexpected documentation.
1439.RE
1440.SS Suppressing Messages
1441.PP
1442DocLint checks for and recognizes two strings that may be present in the
1443arguments for an \f[V]\[at]SuppressWarnings\f[R] annotation.
1444.IP \[bu] 2
1445\f[V]doclint\f[R]
1446.IP \[bu] 2
1447\f[V]doclint:\f[R]\f[I]LIST\f[R]
1448.PP
1449where \f[I]LIST\f[R] is a comma-separated list of one or more of
1450\f[V]accessibility\f[R], \f[V]html\f[R], \f[V]missing\f[R],
1451\f[V]reference\f[R], \f[V]syntax\f[R].
1452.PP
1453The names in \f[I]LIST\f[R] are the same \f[B]group\f[R] names supported
1454by the command-line \f[V]-Xdoclint\f[R] option for \f[V]javac\f[R] and
1455\f[V]javadoc\f[R].
1456(This is the same convention honored by the \f[V]javac\f[R]
1457\f[V]-Xlint\f[R] option and the corresponding names supported by
1458\f[V]\[at]SuppressWarnings\f[R].)
1459.PP
1460The names in \f[I]LIST\f[R] can equivalently be specified in separate
1461arguments of the annotation.
1462For example, the following are equivalent:
1463.IP \[bu] 2
1464\f[V]\[at]SuppressWarnings(\[dq]doclint:accessibility,missing\[dq])\f[R]
1465.IP \[bu] 2
1466\f[V]\[at]SuppressWarnings(\[dq]doclint:accessibility\[dq], \[dq]doclint:missing\[dq])\f[R]
1467.PP
1468When DocLint detects an issue in a documentation comment, it checks for
1469the presence of \f[V]\[at]SuppressWarnings\f[R] on the associated
1470declaration and on all lexically enclosing declarations.
1471The issue will be ignored if any such annotation is found containing the
1472simple string \f[V]doclint\f[R] or the longer form
1473\f[V]doclint:LIST\f[R] where \f[I]LIST\f[R] contains the name of the
1474group for the issue.
1475.PP
1476\f[I]Note:\f[R] as with other uses of \f[V]\[at]SuppressWarnings\f[R],
1477using the annotation on a module or package declaration only affects
1478that declaration; it does not affect the contents of the module or
1479package in other source files.
1480.PP
1481All messages related to an issue are suppressed by the presence of an
1482appropriate \f[V]\[at]SuppressWarnings\f[R] annotation: this includes
1483errors as well as warnings.
1484.PP
1485\f[I]Note:\f[R] It is only possible to \f[I]suppress\f[R] messages.
1486If an annotation of \f[V]\[at]SuppressWarnings(\[dq]doclint\[dq])\f[R]
1487is given on a top-level declaration, all DocLint messages for that
1488declaration and any enclosed declarations will be suppressed; it is not
1489possible to selectively re-enable messages for issues in enclosed
1490declarations.
1491.SS Comparison with downstream validation tools
1492.PP
1493DocLint is a utility built into \f[V]javac\f[R] and \f[V]javadoc\f[R]
1494that checks the content of documentation comments, as found in source
1495files.
1496In contrast, downstream validation tools can be used to validate the
1497output generated from those documentation comments by \f[V]javadoc\f[R]
1498and the standard doclet.
1499.PP
1500Although there is some overlap in functionality, the two mechanisms are
1501different and each has its own strengths and weaknesses.
1502.IP \[bu] 2
1503Downstream validation tools can check the end result of any generated
1504documentation, as it will be seen by the end user.
1505This includes content from all sources, including documentation
1506comments, the standard doclet itself, user-provided taglets, and content
1507supplied via command-line options.
1508Because such tools are analyzing complete HTML pages, they can do more
1509complete checks than can DocLint.
1510However, when a problem is found in the generated pages, it can be
1511harder to track down exactly where in the build pipeline the problem
1512needs to be fixed.
1513.IP \[bu] 2
1514DocLint checks the content of documentation comments, in source files.
1515This makes it very easy to identify the exact position of any issues
1516that may be found.
1517DocLint can also detect some semantic errors in documentation comments
1518that downstream tools cannot detect, such as missing comments, using an
1519\f[V]\[at]return\f[R] tag in a method returning \f[V]void\f[R], or an
1520\f[V]\[at]param\f[R] tag describing a non-existent parameter.
1521But by its nature, DocLint cannot report on problems such as missing
1522links, or errors in user-provided custom taglets, or problems in the
1523standard doclet itself.
1524It also cannot reliably detect errors in documentation comments at the
1525boundaries between content in a documentation comment and content
1526generated by a custom taglet.
1527