2015-01-30 Vladimir Makarov <vmakarov@redhat.com>
[official-gcc.git] / libjava / classpath / doc / cp-tools.texinfo
blobc3cc5ff8cdf45efa53f77896d966796bf8450192
1 \input texinfo @c -*-texinfo-*-
3 @c %**start of header
4 @setfilename cp-tools.info
5 @settitle GNU Classpath Tools Guide
6 @c %**end of header
8 @copying
9 This file documents the Tools included in a standard distribution of the GNU
10 Classpath project deliverables.
12 Copyright @copyright{} 2006, 2007 Free Software Foundation, Inc.
14 @quotation
15 Permission is granted to make and distribute verbatim copies of this document provided the copyright notice and this permission notice are preserved on all copies.
17 Permission is granted to copy and distribute modified versions of this document under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.
19 Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the Free Software Foundation.
20 @end quotation
21 @end copying
23 @c Common macros to support generating man pages:
25 @macro gcctabopt{body}
26 @code{\body\}
27 @end macro
28 @macro gccoptlist{body}
29 @smallexample
30 \body\
31 @end smallexample
32 @end macro
34 @ifinfo
35 @ifnotplaintext
36 @setchapternewpage on
38 @dircategory GNU Libraries
39 @direntry
40 * Classpath Tools: (cp-tools).  GNU Classpath Tools Guide
41 @end direntry
42 @end ifnotplaintext
43 @end ifinfo
45 @titlepage
46 @title GNU Classpath Tools Guide
47 @author The GNU Classpath Team
49 @page
50 @vskip 0pt plus 1filll
51 @insertcopying
52 @end titlepage
54 @contents
56 @ifinfo
57 @node Top, Applet Tools, (dir), (dir)
58 @top GNU Classpath Tools Guide
60 This document contains important information you need to know in order to use
61 the tools included in the GNU Classpath project deliverables.
63 The Tools aim at providing a free replacement, similar in their behavior, to
64 their counter-parts found in the Reference Implementation (RI) of the Java
65 Software Development Kit (SDK).
67 @end ifinfo
69 @menu
70 * Applet Tools::               Work with applets
71 * Security Tools::             Work securely with Java applications
72 * Other Tools::                Other tools in classpath
73 * I18N Issues::                How to add support for non-English languages
75 @detailmenu
76  --- The Detailed Node Listing ---
78 Applet Tools
80 * appletviewer Tool::          Load applets
81 * gcjwebplugin::               Load applets in a web browser
83 Security Tools
85 * jarsigner Tool::             Sign and verify .JAR files
86 * keytool Tool::               Manage private keys and public certificates
88 jarsigner Tool
90 * Common jarsigner Options::   Options used when signing or verifying a file
91 * Signing Options::            Options only used when signing a .JAR file
92 * Verification Options::       Options only used when verifying a .JAR file
94 keytool Tool
96 * Getting Help::               How to get help with keytool commands
97 * Common keytool Options::     Options used in more than one command
98 * Distinguished Names::        X.500 Distinguished Names used in certificates
99 * Add/Update Commands::        Commands for adding data to a Key Store
100 * Export Commands::            Commands for exporting data from a Key Store
101 * Display Commands::           Commands for displaying data in a Key Store
102 * Management Commands::        Commands for managing a Key Store
104 Add/Update Commands
106 * Command -genkey::            Generate private key and self-signed certificate
107 * Command -import::            Import certificates and certificate replies
108 * Command -selfcert::          Generate self-signed certificate
109 * Command -cacert::            Import a CA Trusted Certificate
110 * Command -identitydb::        Import JDK-1 style identities
112 Export Commands
114 * Command -certreq::           Generate Certificate Signing Requests (CSR)
115 * Command -export::            Export a certificate in a Key Store
117 Display Commands
119 * Command -list::              Display information about one or all Aliases
120 * Command -printcert::         Print a certificate or a certificate fingerprint
122 Management Commands
124 * Command -keyclone::          Clone a Key Entry in a Key Store
125 * Command -storepasswd::       Change the password protecting a Key Store
126 * Command -keypasswd::         Change the password protecting a Key Entry
127 * Command -delete::            Remove an entry in a Key Store
129 Other Tools
131 * jar Tool::                   Archive tool for Java archives
132 * javah Tool::                 A java header compiler
133 * gcjh Tool::                  A java header compiler (old version)
134 * native2ascii Tool::          An encoding converter
135 * orbd Tool::                  An object request broker daemon
136 * serialver Tool::             A serial version command
137 * rmid Tool::                  RMI activation daemon
138 * rmiregistry Tool::           Remote object registry
139 * tnameserv Tool::             Naming service
140 * gjdoc Tool::                 Documenation generator tool.
142 Generating HTML Documentation
144 * Invoking the Standard Doclet::   How to generate HTML documentation.
145 * Invoking a Custom Doclet::       How to run third-party and other 
146                                    built-in Doclets.
148 * Option Summary by Type::         Brief list of all options, grouped by type.
149 * Gjdoc Option Summary::           List of all options accepted by Gjdoc.
151 * Source Set Options::      Select the set of source codes to run Gjdoc on.
152 * Source Format Options::   Specify the format of the source codes to document.
154 * Interlinking Options::    Connection your documentation with other projects.
155 * Output Control Options::  Specify the target directory and locale, and more.
156 * Generation Options::      Select which pieces of information to generate.
157 * Decoration Options::      Add or modify some titles, headers and footers or
158                             override/amend static resources like stylesheets.
159 * Taglet Options::          Define your own javadoc @@tags.
161 * Virtual Machine Options:: Controlling the kind of output:
162                             an executable, object files, assembler files,
163                             or preprocessed source.
164 * Verbosity Options::
165 * Doclet Options::
167 * Other Doclets::           Generating Other Output Types. 
169 * Built-in Doclets::        Using the Built-in Doclets.
170 * Using XmlDoclet::
171 * Using TexiDoclet::
172 * Using IspellDoclet::
173 * Using DebugDoclet::
175 * Third-party Doclets::     Using Third-Party Doclets.
176 * DocBook Doclet::
177 * PDFDoclet::
178 * JUnitDoclet::
180 * Gjdoc Concepts::          Advanced Concepts.
181 * Writing Doclets::
183 * Doclet Invocation Interface::    Implementing the Doclet Invocation Interface
184 * Using AbstractDoclet::           Deriving Your Doclet from AbstractDoclet.
185 * GNU Doclet SPI::                 Preparing the GNU Doclet Service Provider
186                                    Interface.
188 * Taglets::                        Adding Custom Tags to the Documentation.
189 * XHTML Fragments::                Well-Formed Documentation Fragments.
190 * First Sentence Detector::        How Gjdoc Determines where the First
191                                    Sentence Ends.
192 * Adding Custom Resources::        Adding Images and Other Resources.
194 I18N Issues
196 * Language Resources::         Where resources are located
197 * Message Formats::            How messages are internationalized
199 @end detailmenu
200 @end menu
202 @comment ----------------------------------------------------------------------
204 @node Applet Tools, Security Tools, Top, Top
205 @comment node-name, next, previous, up
206 @chapter Applet Tools
208 Two Applet Tools are available with GNU Classpath: @b{appletviewer}
209 and @b{gcjwebplugin}.
211 To avoid conflicts with other implementations, the appletviewer
212 executable is called ``gappletviewer''.
214 @menu
215 * appletviewer Tool::          Load applets
216 * gcjwebplugin::               Load applets in a web browser
217 @end menu
219 If while using these tools you think you found a bug, then please report it at @uref{http://www.gnu.org/software/classpath/bugs.html,classpath-bugs}.
221 @comment ----------------------------------------------------------------------
223 @node appletviewer Tool, gcjwebplugin, Applet Tools, Applet Tools
224 @comment node-name, next, previous, up
225 @section The @code{appletviewer} Tool
226 @c man title gappletviewer Load and runs an applet
228 SYNOPSIS
230 @c man begin SYNOPSIS gappletviewer
231 appletviewer [@var{OPTION}]@dots{} @var{URL}@dots{} @var{@*}
233 appletviewer [@var{OPTION}]@dots{} @option{-code} @var{CODE} @var{@*}
235 appletviewer [@var{OPTION}]@dots{} @option{-plugin} @var{INPUT},@var{OUTPUT}
236 @c man end
238 DESCRIPTION
239 @c man begin DESCRIPTION gappletviewer
240 The @command{appletviewer} tool loads and runs an applet.
242 Use the first form to test applets specified by tag.  The URL should
243 resolve to an HTML document from which the @command{appletviewer} will
244 extract applet tags.  The APPLET, EMBED and OBJECT tags are supported.
245 If a given document contains multiple applet tags, all the applets
246 will be loaded, with each applet appearing in its own window.
247 Likewise, when multiple URLs are specified, each applet tag instance
248 is given its own window.  If a given document contains no recognized
249 tags the @command{appletviewer} does nothing.
251 @smallexample
252 appletviewer http://www.gnu.org/software/classpath/
253 @end smallexample
255 Use the second form to test an applet in development.  This form
256 allows applet tag attributes to be supplied on the command line.  Only
257 one applet may be specified using the @option{-code} option.  The
258 @option{-code} option overrides the URL form -- any URLs specified will
259 be ignored.
261 @smallexample
262 appletviewer -code Test.class -param datafile,data.txt
263 @end smallexample
265 @command{gcjwebplugin} uses the third form to communicate with the
266 @command{appletviewer} through named pipes.
267 @c man end
269 @c man begin OPTIONS gappletviewer
270 URL OPTIONS
271 @table @gcctabopt
272 @item -debug
273 This option is not yet implemented but is provided for compatibility.
275 @item -encoding @var{CHARSET}
276 Use this option to specify an alternate character encoding for the
277 specified HTML page.
279 @end table
281 APPLET TAG OPTIONS
282 @table @gcctabopt
283 @item -code @var{CODE}
284 Use the @option{-code} option to specify the value of the applet tag
285 @var{CODE} attribute.
287 @item -codebase @var{CODEBASE}
288 Use the @option{-codebase} option to specify the value of the applet tag
289 @var{CODEBASE} attribute.
291 @item -archive @var{ARCHIVE}
292 Use the @option{-archive} option to specify the value of the applet tag
293 @var{ARCHIVE} attribute.
295 @item -width @var{WIDTH}
296 Use the @option{-width} option to specify the value of the applet tag
297 @var{WIDTH} attribute.
299 @item -height @var{HEIGHT}
300 Use the @option{-height} option to specify the value of the applet tag
301 @var{HEIGHT} attribute.
303 @item -param @var{NAME},@var{VALUE}
304 Use the @option{-param} option to specify values for the @var{NAME}
305 and @var{VALUE} attributes of an applet PARAM tag.
307 @end table
309 PLUGIN OPTION
310 @table @gcctabopt
311 @item -plugin @var{INPUT},@var{OUTPUT}
312 @command{gcjwebplugin} uses the @option{-plugin} option to specify the
313 named pipe the @command{appletviewer} should use for receiving commands
314 (@var{INPUT}) and the one it should use for sending commands to
315 @command{gcjwebplugin} (@var{OUTPUT}).
317 @end table
319 DEBUGGING OPTION
320 @table @gcctabopt
321 @item -verbose
322 Use the @option{-verbose} option to have the @command{appletviewer} print
323 debugging messages.
325 @end table
327 STANDARD OPTIONS
329 @table @gcctabopt
330 @item -help
331 Use the @option{-help} option to have the @command{appletviewer} print a
332 usage message, then exit.
334 @item -version
335 Use the @option{-version} option to have the @command{appletviewer} print
336 its version, then exit.
338 @item -J@var{OPTION}
339 Use the @option{-J} option to pass @var{OPTION} to the virtual machine that
340 will run the @command{appletviewer}.  Unlike other options, there must
341 not be a space between the @option{-J} and @var{OPTION}.
343 @end table
344 @c man end
346 @comment ----------------------------------------------------------------------
348 @node gcjwebplugin, , appletviewer Tool, Applet Tools
349 @comment node-name, next, previous, up
350 @section The @code{gcjwebplugin} Tool
352 @code{gcjwebplugin} is a plugin that adds applet support to web
353 browsers.  Currently @code{gcjwebplugin} only supports Mozilla-based
354 browsers (e.g., Firefox, Galeon, Mozilla).
356 @comment ----------------------------------------------------------------------
358 @node Security Tools, Other Tools, Applet Tools, Top
359 @comment node-name, next, previous, up
360 @chapter Security Tools
362 Two Security Tools are available with GNU Classpath:
363 @command{jarsigner} and @command{keytool}.
365 To avoid conflicts with other implementations, the jarsigner
366 executable is called @command{gjarsigner} and the keytool executable is
367 called @command{gkeytool}.
369 @menu
370 * jarsigner Tool::             Sign and verify .JAR files
371 * keytool Tool::               Manage private keys and public certificates
372 @end menu
374 If while using these tools you think you found a bug, then please report it at @uref{http://www.gnu.org/software/classpath/bugs.html,classpath-bugs}.
376 @comment ----------------------------------------------------------------------
378 @node jarsigner Tool, keytool Tool, Security Tools, Security Tools
379 @comment node-name, next, previous, up
380 @section The @code{jarsigner} Tool
381 @c man title gjarsigner Java ARchive (JAR) file signing and verification tool
383 The @command{jarsigner} tool is invoked from the command line, in one
384 of two forms, as follows:
386 @example
387 @c man begin SYNOPSIS gjarsigner
388 jarsigner [@var{OPTION}]@dots{} @var{FILE} @var{ALIAS}
390 jarsigner @option{-verify} [@var{OPTION}]@dots{} @var{FILE}
391 @c man end
392 @end example
394 @c man begin DESCRIPTION gjarsigner
395 When the first form is used, the tool signs the designated JAR file. The second form, on the other hand, is used to verify a previously signed JAR file.
397 @var{FILE} is the .JAR file to process; i.e., to sign if the first syntax form is used, or to verify if the second syntax form is used instead.
399 @var{ALIAS} must be a known @i{Alias} of a @i{Key Entry} in the designated @i{Key Store}. The private key material associated with this @i{Alias} is then used for signing the designated .JAR file.
400 @c man end
402 @menu
403 * Common jarsigner Options::   Options used when signing or verifying a file
404 * Signing Options::            Options only used when signing a .JAR file
405 * Verification Options::       Options only used when verifying a .JAR file
406 @end menu
408 @comment ----------------------------------------------------------------------
410 @node Common jarsigner Options, Signing Options, jarsigner Tool, jarsigner Tool
411 @comment node-name, next, previous, up
412 @c man begin OPTIONS gjarsigner
413 @subsection Common options
415 The following options may be used when the tool is used for either signing, or verifying, a .JAR file.
417 @table @gcctabopt
418 @item -verbose
419 Use this option to force the tool to generate more verbose messages, during its processing.
421 @item -internalsf
422 When present, the tool will include --which otherwise it does not-- the @code{.SF} file in the @code{.DSA} generated file.
424 @item -sectionsonly
425 When present, the tool will include in the @code{.SF} generated file --which otherwise it does not-- a header containing a hash of the whole manifest file.  When that header is included, the tool can quickly check, during verification, if the hash (in the header) matches or not the manifest file.
427 @item -provider PROVIDER_CLASS_NAME
428 A fully qualified class name of a @i{Security Provider} to add to the current list of @i{Security Providers} already installed in the JVM in-use. If a provider class is specified with this option, and was successfully added to the runtime --i.e.@: it was not already installed-- then the tool will attempt to remove this @i{Security Provider} before exiting.
430 @item -help
431 Prints a help text similar to this one.
433 @end table
434 @c man end
436 @comment ----------------------------------------------------------------------
438 @node Signing Options, Verification Options, Common jarsigner Options, jarsigner Tool
439 @comment node-name, next, previous, up
440 @c man begin OPTIONS gjarsigner
441 @subsection Signing options
443 The following options may be specified when using the tool for signing purposes.
445 @table @gcctabopt
446 @item -keystore @var{URL}
447 Use this option to specify the location of the key store to use. The default value is a file URL referencing the file named @file{.keystore} located in the path returned by the call to @code{java.lang.System#getProperty(String)} using @code{user.home} as argument.
449 If a URL was specified, but was found to be malformed --e.g.@: missing protocol element-- the tool will attempt to use the URL value as a file-name (with absolute or relative path-name) of a key store --as if the protocol was @code{file:}.
451 @item -storetype @var{STORE_TYPE}
452 Use this option to specify the type of the key store to use. The default value, if this option is omitted, is that of the property @code{keystore.type} in the security properties file, which is obtained by invoking the static method call @code{getDefaultType()} in @code{java.security.KeyStore}.
454 @item -storepass @var{PASSWORD}
455 Use this option to specify the password which will be used to unlock the key store. If this option is missing, the User will be prompted to provide a password.
457 @item -keypass @var{PASSWORD}
458 Use this option to specify the password which the tool will use to unlock the @i{Key Entry} associated with the designated @i{Alias}.
460 If this option is omitted, the tool will first attempt to unlock the @i{Key Entry} using the same password protecting the key store. If this fails, you will then be prompted to provide a password.
462 @item -sigfile @var{NAME}
463 Use this option to designate a literal that will be used to construct file names for both the @code{.SF} and @code{.DSA} signature files. These files  will be generated, by the tool, and placed in the @file{META-INF} directory of the signed JAR@.  Permissible characters for @var{NAME} must be in the range "a-zA-Z0-9_-".  All characters will be converted to upper-case ones.
465 If this option is missing, the first eight characters of the @var{ALIAS} argument will be used. When this is the case, any character in @var{ALIAS} that is outside the permissible range of characters will be replaced by an underscore.
467 @item -signedjar @var{FILE}
468 Use this option to specify the file name of the signed JAR@. If this option is omitted, then the signed JAR will be named the same as @var{FILE}; i.e., the input JAR file will be replaced with the signed copy.
470 @end table
471 @c man end
473 @comment ----------------------------------------------------------------------
475 @node Verification Options, , Signing Options, jarsigner Tool
476 @comment node-name, next, previous, up
477 @c man begin OPTIONS gjarsigner
478 @subsection Verification options
480 The following options may be specified when using the tool for verification purposes.
482 @table @gcctabopt
483 @item -verify
484 Use this option to indicate that the tool is to be used for verification purposes.
486 @item -certs
487 This option is used in conjunction with the @option{-verbose} option. When present, along with the @option{-verbose} option, the tool will print more detailed information about the certificates of the signer(s) being processed.
489 @end table
490 @c man end
492 @comment ----------------------------------------------------------------------
494 @node keytool Tool, , jarsigner Tool, Security Tools
495 @comment node-name, next, previous, up
496 @section The @code{keytool} Tool
497 @c man title gkeytool Manage private keys and public certificates
499 @ignore
500 @c man begin SYNOPSIS gkeytool
501 keytool [@var{COMMAND}] @dots{}
502 @c man end
503 @end ignore
505 @c man begin DESCRIPTION gkeytool
506 Cryptographic credentials, in a Java environment, are usually stored in a @i{Key Store}. The Java SDK specifies a @i{Key Store} as a persistent container of two types of objects: @i{Key Entries} and @i{Trusted Certificates}. The security tool @command{keytool} is a Java-based application for managing those types of objects.
508 A @i{Key Entry} represents the private key part of a key-pair used in Public-Key Cryptography, and a signed X.509 certificate which authenticates the public key part for a known entity; i.e.@: the owner of the key-pair. The X.509 certificate itself contains the public key part of the key-pair.
510 A @i{Trusted Certificate} is a signed X.509 certificate issued by a trusted entity. The @i{Trust} in this context is relative to the User of the @command{keytool}. In other words, the existence of a @i{Trusted Certificate} in the @i{Key Store} processed by a @command{keytool} command implies that the User trusts the @i{Issuer} of that @i{Trusted Certificate} to also sign, and hence authenticates, other @i{Subjects} the tool may process.
512 @i{Trusted Certificates} are important because they allow the tool to mechanically construct @i{Chains of Trust} starting from one of the @i{Trusted Certificates} in a @i{Key Store} and ending with a certificate whose @i{Issuer} is potentially unknown. A valid chain is an ordered list, starting with a @i{Trusted Certificate} (also called the @i{anchor}), ending with the target certificate, and satisfying the condition that the @i{Subject} of certificate @code{#i} is the @i{Issuer} of certificate @code{#i + 1}.
514 The @command{keytool} is invoked from the command line as follows:
516 @smallexample
517 keytool [COMMAND] ...
518 @end smallexample
520 Multiple @var{COMMAND}s may be specified at once, each complete with its own options. @command{keytool} will parse all the arguments, before processing, and executing, each @code{COMMAND}. If an exception occurs while executing one @var{COMMAND} @command{keytool} will abort. Note however that because the implementation of the tool uses code to parse command line options that also supports GNU-style options, you have to separate each command group with a double-hyphen; e.g
522 @smallexample
523 keytool -list -- -printcert -alias mykey
524 @end smallexample
525 @c man end
527 Here is a summary of the commands supported by the tool:
529 @c man begin OPTIONS gkeytool
530 @enumerate
531 @item Add/Update commands
532 @table @gcctabopt
533 @item -genkey [@var{OPTION}]@dots{}
534 Generate a new @i{Key Entry}, eventually creating a new key store.
536 @item -import [@var{OPTION}]@dots{}
537 Add, to a key store, @i{Key Entries} (private keys and certificate chains authenticating the public keys) and @i{Trusted Certificates} (3rd party certificates which can be used as @i{Trust Anchors} when building chains-of-trust).
539 @item -selfcert [@var{OPTION}]@dots{}
540 Generate a new self-signed @i{Trusted Certificate}.
542 @item -cacert [@var{OPTION}]@dots{}
543 Import a CA @i{Trusted Certificate}.
545 @item -identitydb [@var{OPTION}]@dots{}
546 @b{NOT IMPLEMENTED YET}.@*
547 Import a JDK 1.1 style Identity Database.
548 @end table
550 @item Export commands
551 @table @gcctabopt
552 @item -certreq [@var{OPTION}]@dots{}
553 Issue a @i{Certificate Signing Request} (CSR) which can be then sent to a @i{Certification Authority} (CA) to issue a certificate signed (by the CA) and authenticating the @i{Subject} of the request.
555 @item -export [@var{OPTION}]@dots{}
556 Export a certificate from a key store.
557 @end table
559 @item  Display commands
560 @table @gcctabopt
561 @item -list [@var{OPTION}]@dots{}
562 Print one or all certificates in a key store to @code{STDOUT}.
564 @item -printcert [@var{OPTION}]@dots{}
565 Print a human-readable form of a certificate, in a designated file, to @code{STDOUT}.
566 @end table
568 @item Management commands
569 @table @gcctabopt
570 @item -keyclone [@var{OPTION}]@dots{}
571 Clone a @i{Key Entry} in a key store.
573 @item -storepasswd [@var{OPTION}]@dots{}
574 Change the password protecting a key store.
576 @item -keypasswd [@var{OPTION}]@dots{}
577 Change the password protecting a @i{Key Entry} in a key store.
579 @item -delete [@var{OPTION}]@dots{}
580 Delete a @i{Key Entry} or a @i{Trusted Certificate} from a key store.
581 @end table
582 @end enumerate
583 @c man end
585 @menu
586 * Getting Help::               How to get help with keytool commands
587 * Common keytool Options::     Options used in more than one command
588 * Distinguished Names::        X.500 Distinguished Names used in certificates
589 * Add/Update Commands::        Commands for adding data to a Key Store
590 * Export Commands::            Commands for exporting data from a Key Store
591 * Display Commands::           Commands for displaying data in a Key Store
592 * Management Commands::        Commands for managing a Key Store
593 @end menu
595 @comment ----------------------------------------------------------------------
597 @node Getting Help, Common keytool Options, keytool Tool, keytool Tool
598 @comment node-name, next, previous, up
599 @subsection Getting help
601 To get a general help text about the tool, use the @code{-help} option; e.g.
603 @example
604 @code{keytool -help}
605 @end example
607 To get more specific help text about one of the tool's command use the @code{-help} option for that command; e.g.
609 @example
610 @code{keytool -genkey -help}
611 @end example
613 In both instances, the tool will print a help text and then will exit the running JVM.
615 It is worth noting here that the help messages printed by the tool are I18N-ready. This means that if/when the contents of the tool's @i{Message Bundle} properties file are available in languages other than English, you may see those messages in that language.
617 @comment ----------------------------------------------------------------------
619 @node Common keytool Options, Distinguished Names, Getting Help, keytool Tool
620 @comment node-name, next, previous, up
621 @c man begin OPTIONS gkeytool
622 @subsection Common options
624 The following @option{OPTION}s are used in more than one @command{COMMAND}. They are described here to reduce redundancy.
626 @table @gcctabopt
627 @anchor{alias}
628 @item -alias @var{Alias}
629 Every entry, be it a @i{Key Entry} or a @i{Trusted Certificate}, in a key store is uniquely identified by a user-defined @var{Alias} string. Use this option to specify the @var{Alias} to use when referring to an entry in the key store. Unless specified otherwise, a default value of @code{mykey} shall be used when this option is omitted from the command line.
631 @anchor{keyalg}
632 @item -keyalg @var{ALGORITHM}
633 Use this option to specify the canonical name of the key-pair generation algorithm. The default value for this option is @code{DSS} (a synonym for the Digital Signature Algorithm also known as DSA).
635 @anchor{keysize}
636 @item -keysize @var{SIZE}
637 Use this option to specify the number of bits of the shared modulus (for both the public and private keys) to use when generating new keys. A default value of @code{1024} will be used if this option is omitted from the command line.
639 @anchor{validity}
640 @item -validity @var{DAY_COUNT}
641 Use this option to specify the number of days a newly generated certificate will be valid for. The default value is @code{90} (days) if this option is omitted from the command line.
643 @anchor{storetype}
644 @item -storetype @var{STORE_TYPE}
645 Use this option to specify the type of the key store to use. The default value, if this option is omitted, is that of the property @code{keystore.type} in the security properties file, which is obtained by invoking the static method call @code{getDefaultType()} in @code{java.security.KeyStore}.
647 @anchor{storepass}
648 @item -storepass @var{PASSWORD}
649 Use this option to specify the password protecting the key store. If this option is omitted from the command line, you will be prompted to provide a password.
651 @anchor{keystore}
652 @item -keystore @var{URL}
653 Use this option to specify the location of the key store to use. The default value is a file URL referencing the file named @file{.keystore} located in the path returned by the call to @code{java.lang.System#getProperty(String)} using @code{user.home} as argument.
655 If a URL was specified, but was found to be malformed --e.g.@: missing protocol element-- the tool will attempt to use the URL value as a file-name (with absolute or relative path-name) of a key store --as if the protocol was @code{file:}.
657 @anchor{provider}
658 @item -provider @var{PROVIDER_CLASS_NAME}
659 A fully qualified class name of a @i{Security Provider} to add to the current list of @i{Security Providers} already installed in the JVM in-use. If a provider class is specified with this option, and was successfully added to the runtime --i.e.@: it was not already installed-- then the tool will attempt to removed this @i{Security Provider} before exiting.
661 @anchor{file}
662 @item -file @var{FILE}
663 Use this option to designate a file to use with a command. When specified with this option, the value is expected to be the fully qualified path of a file accessible by the File System. Depending on the command, the file may be used as input or as output. When this option is omitted from the command line, @code{STDIN} will be used instead, as the source of input, and @code{STDOUT} will be used instead as the output destination.
665 @anchor{verbose}
666 @item -v
667 Unless specified otherwise, use this option to enable more verbose output.
669 @end table
670 @c man end
672 @comment ----------------------------------------------------------------------
674 @node Distinguished Names, Add/Update Commands, Common keytool Options, keytool Tool
675 @comment node-name, next, previous, up
676 @subsection X.500 Distinguished Names
678 @anchor{dn}
679 A @i{Distinguished Name} (or DN) MUST be supplied with some of the @code{COMMAND}s using a @code{-dname} option. The syntax of a valid value for this option MUST follow RFC-2253 specifications. Namely the following components (with their accepted meaning) will be recognized. Note that the component name is case-insensitive:
681 @ftable @var
682 @item CN
683 The Common Name; e.g.@: @kbd{host.domain.com}
684 @item OU
685 The Organizational Unit; e.g.@: @kbd{IT Department}
686 @item O
687 The Organization Name; e.g.@: @kbd{The Sample Company}
688 @item L
689 The Locality Name; e.g.@: @kbd{Sydney}
690 @item ST
691 The State Name; e.g.@: @kbd{New South Wales}
692 @item C
693 The 2-letter Country identifier; e.g.@: @kbd{AU}
694 @end ftable
696 When specified with a @code{-dname} option, each pair of component/value will be separated from the other with a comma. Each component and value pair MUST be separated by an equal sign. For example, the following is a valid DN value:@*
698 @format
699 CN=host.domain.com, O=The Sample Company, L=Sydney, ST=NSW, C=AU
700 @end format
702 If the @i{Distinguished Name} is required, and no valid default value can be used, the tool will prompt you to enter the information through the console.
704 @comment ----------------------------------------------------------------------
706 @node Add/Update Commands, Export Commands, Distinguished Names, keytool Tool
707 @comment node-name, next, previous, up
708 @c man begin OPTIONS gkeytool
709 @subsection Add/Update commands
710 @c man end
712 @menu
713 * Command -genkey::            Generate private key and self-signed certificate
714 * Command -import::            Import certificates and certificate replies
715 * Command -selfcert::          Generate self-signed certificate
716 * Command -cacert::            Import a CA Trusted Certificate
717 * Command -identitydb::        Import JDK-1 style identities
718 @end menu
720 @comment ----------------------------------------------------------------------
722 @node Command -genkey, Command -import, Add/Update Commands, Add/Update Commands
723 @comment node-name, next, previous, up
724 @c man begin OPTIONS gkeytool
725 @subsubsection The @option{-genkey} command
727 Use this command to generate a new key-pair (both private and public keys), and save these credentials in the key store as a @i{Key Entry}, associated with the designated (if was specified with the @option{-alias} option) or default (if the @option{-alias} option is omitted) @i{Alias}.
729 The private key material will be protected with a user-defined password (see @option{-keypass} option). The public key on the other hand will be part of a self-signed X.509 certificate, which will form a 1-element chain and will be saved in the key store.
731 @table @gcctabopt
732 @item -alias @var{ALIAS}
733 For more details @pxref{alias,, ALIAS}.
735 @item -keyalg @var{ALGORITHM}
736 For more details @pxref{keyalg,, ALGORITHM}.
738 @item -keysize @var{KEY_SIZE}
739 For more details @pxref{keysize,, KEY_SIZE}.
741 @item -sigalg @var{ALGORITHM}
742 The canonical name of the digital signature algorithm to use for signing certificates. If this option is omitted, a default value will be chosen based on the type of the key-pair; i.e., the algorithm that ends up being used by the -keyalg option. If the key-pair generation algorithm is @code{DSA}, the value for the signature algorithm will be @code{SHA1withDSA}. If on the other hand the key-pair generation algorithm is @code{RSA}, then the tool will use @code{MD5withRSA} as the signature algorithm.
744 @item -dname @var{NAME}
745 This a mandatory value for the command. If no value is specified --i.e.@: the @option{-dname} option is omitted-- the tool will prompt you to enter a @i{Distinguished Name} to use as both the @i{Owner} and @i{Issuer} of the generated self-signed certificate.
747 For more details @pxref{dn,, X.500 DISTINGUISHED NAME}.
749 @item -keypass @var{PASSWORD}
750 Use this option to specify the password which the tool will use to protect the newly created @i{Key Entry}.
752 If this option is omitted, you will be prompted to provide a password.
754 @item -validity @var{DAY_COUNT}
755 For more details @pxref{validity,, DAY_COUNT}.
757 @item -storetype @var{STORE_TYPE}
758 For more details @pxref{storetype,, STORE_TYPE}.
760 @item -keystore @var{URL}
761 For more details @pxref{keystore,, URL}.
763 @item -storepass @var{PASSWORD}
764 For more details @pxref{storepass,, PASSWORD}.
766 @item -provider @var{PROVIDER_CLASS_NAME}
767 For more details @pxref{provider,, PROVIDER_CLASS_NAME}.
769 @item -v
770 For more details @pxref{verbose}.
772 @end table
773 @c man end
775 @comment ----------------------------------------------------------------------
777 @node Command -import, Command -selfcert, Command -genkey, Add/Update Commands
778 @comment node-name, next, previous, up
779 @c man begin OPTIONS gkeytool
780 @subsubsection The @option{-import} command
782 Use this command to read an X.509 certificate, or a PKCS#7 @i{Certificate Reply} from a designated input source and incorporate the certificates into the key store.
784 If the @i{Alias} does not already exist in the key store, the tool treats the certificate read from the input source as a new @i{Trusted Certificate}. It then attempts to discover a chain-of-trust, starting from that certificate and ending at another @i{Trusted Certificate}, already stored in the key store. If the @option{-trustcacerts} option is present, an additional key store, of type @code{JKS} named @file{cacerts}, and assumed to be present in @file{$@{JAVA_HOME@}/lib/security} will also be consulted if found --@code{$@{JAVA_HOME@}} refers to the location of an installed @i{Java Runtime Environment} (JRE). If no chain-of-trust can be established, and unless the @code{-noprompt} option has been specified, the certificate is printed to @code{STDOUT} and the user is prompted for a confirmation.
786 If @i{Alias} exists in the key store, the tool will treat the certificate(s) read from the input source as a @i{Certificate Reply}, which can be a chain of certificates, that eventually would replace the chain of certificates associated with the @i{Key Entry} of that @i{Alias}. The substitution of the certificates only occurs if a chain-of-trust can be established between the bottom certificate of the chain read from the input file and the @i{Trusted Certificates} already present in the key store. Again, if the @option{-trustcacerts} option is specified, additional @i{Trusted Certificates} in the same @file{cacerts} key store will be considered. If no chain-of-trust can be established, the operation will abort.
788 @table @gcctabopt
789 @item -alias @var{ALIAS}
790 For more details @pxref{alias,, ALIAS}.
792 @item -file @var{FILE}
793 For more details @pxref{file,, FILE}.
795 @item -keypass @var{PASSWORD}
796 Use this option to specify the password which the tool will use to protect the @i{Key Entry} associated with the designated @i{Alias}, when replacing this @i{Alias}' chain of certificates with that found in the certificate reply.
798 If this option is omitted, and the chain-of-trust for the certificate reply has been established, the tool will first attempt to unlock the @i{Key Entry} using the same password protecting the key store. If this fails, you will then be prompted to provide a password.
800 @item -noprompt
801 Use this option to prevent the tool from prompting the user.
803 @item -trustcacerts
804 Use this option to indicate to the tool that a key store, of type @code{JKS}, named @file{cacerts}, and usually located in @file{lib/security} in an installed @i{Java Runtime Environment} should be considered when trying to establish chain-of-trusts.
806 @item -storetype @var{STORE_TYPE}
807 For more details @pxref{storetype,, STORE_TYPE}.
809 @item -keystore @var{URL}
810 For more details @pxref{keystore,, URL}.
812 @item -storepass @var{PASSWORD}
813 For more details @pxref{storepass,, PASSWORD}.
815 @item -provider @var{PROVIDER_CLASS_NAME}
816 For more details @pxref{provider,, PROVIDER_CLASS_NAME}.
818 @item -v
819 For more details @pxref{verbose}.
821 @end table
822 @c man end
824 @comment ----------------------------------------------------------------------
826 @node Command -selfcert, Command -cacert, Command -import, Add/Update Commands
827 @comment node-name, next, previous, up
828 @c man begin OPTIONS gkeytool
829 @subsubsection The @option{-selfcert} command
831 Use this command to generate a self-signed X.509 version 1 certificate. The newly generated certificate will form a chain of one element which will replace the previous chain associated with the designated @i{Alias} (if @option{-alias} option was specified), or the default @i{Alias} (if @option{-alias} option was omitted).
833 @table @gcctabopt
834 @item -alias @var{ALIAS}
835 For more details @pxref{alias,, ALIAS}.
837 @item -sigalg @var{ALGORITHM}
838 The canonical name of the digital signature algorithm to use for signing the certificate. If this option is omitted, a default value will be chosen based on the type of the private key associated with the designated @i{Alias}. If the private key is a @code{DSA} one, the value for the signature algorithm will be @code{SHA1withDSA}. If on the other hand the private key is an @code{RSA} one, then the tool will use @code{MD5withRSA} as the signature algorithm.
840 @item -dname @var{NAME}
841 Use this option to specify the @i{Distinguished Name} of the newly generated self-signed certificate. If this option is omitted, the existing @i{Distinguished Name} of the base certificate in the chain associated with the designated @i{Alias} will be used instead.
843 For more details @pxref{dn,, X.500 DISTINGUISHED NAME}.
845 @item -validity @var{DAY_COUNT}
846 For more details @pxref{validity,, DAY_COUNT}.
848 @item -keypass @var{PASSWORD}
849 Use this option to specify the password which the tool will use to unlock the @i{Key Entry} associated with the designated @i{Alias}.
851 If this option is omitted, the tool will first attempt to unlock the @i{Key Entry} using the same password protecting the key store. If this fails, you will then be prompted to provide a password.
853 @item -storetype @var{STORE_TYPE}
854 For more details @pxref{storetype,, STORE_TYPE}.
856 @item -keystore @var{URL}
857 For more details @pxref{keystore,, URL}.
859 @item -storepass @var{PASSWORD}
860 For more details @pxref{storepass,, PASSWORD}.
862 @item -provider @var{PROVIDER_CLASS_NAME}
863 For more details @pxref{provider,, PROVIDER_CLASS_NAME}.
865 @item -v
866 For more details @pxref{verbose}.
868 @end table
869 @c man end
871 @comment ----------------------------------------------------------------------
873 @node Command -cacert, Command -identitydb, Command -selfcert, Add/Update Commands
874 @comment node-name, next, previous, up
875 @c man begin OPTIONS gkeytool
876 @subsubsection The @option{-cacert} command
878 Use this command to import, a CA certificate and add it to the key store as a @i{Trusted Certificate}. The @i{Alias} for this new entry will be constructed from the FILE's base-name after replacing hyphens and dots with underscores.
880 This command is useful when used in a script that recursively visits a directory of CA certificates to populate a @code{cacerts.gkr} @i{Key Store} of trusted certificates which can then be used commands that specify the @option{-trustcacerts} option.
882 @table @gcctabopt
883 @item -file @var{FILE}
884 For more details @pxref{file,, FILE}.
886 @item -storetype @var{STORE_TYPE}
887 For more details @pxref{storetype,, STORE_TYPE}.
889 @item -keystore @var{URL}
890 For more details @pxref{keystore,, URL}.
892 @item -storepass @var{PASSWORD}
893 For more details @pxref{storepass,, PASSWORD}.
895 @item -provider @var{PROVIDER_CLASS_NAME}
896 For more details @pxref{provider,, PROVIDER_CLASS_NAME}.
898 @item -v
899 For more details @pxref{verbose}.
901 @end table
902 @c man end
904 @comment ----------------------------------------------------------------------
906 @node Command -identitydb, , Command -cacert, Add/Update Commands
907 @comment node-name, next, previous, up
908 @c man begin OPTIONS gkeytool
909 @subsubsection The @option{-identitydb} command
911 @b{NOT IMPLEMENTED YET}.
913 Use this command to import a JDK 1.1 style Identity Database.
915 @table @gcctabopt
916 @item -file @var{FILE}
917 For more details @pxref{file,, FILE}.
919 @item -storetype @var{STORE_TYPE}
920 For more details @pxref{storetype,, STORE_TYPE}.
922 @item -keystore @var{URL}
923 For more details @pxref{keystore,, URL}.
925 @item -storepass @var{PASSWORD}
926 For more details @pxref{storepass,, PASSWORD}.
928 @item -provider @var{PROVIDER_CLASS_NAME}
929 For more details @pxref{provider,, PROVIDER_CLASS_NAME}.
931 @item -v
932 For more details @pxref{verbose}.
934 @end table
935 @c man end
937 @comment ----------------------------------------------------------------------
939 @node Export Commands, Display Commands, Add/Update Commands, keytool Tool
940 @comment node-name, next, previous, up
941 @c man begin OPTIONS gkeytool
942 @subsection Export commands
943 @c man end
945 @menu
946 * Command -certreq::           Generate Certificate Signing Requests (CSR)
947 * Command -export::            Export a certificate in a Key Store
948 @end menu
950 @comment ----------------------------------------------------------------------
952 @node Command -certreq, Command -export, Export Commands, Export Commands
953 @comment node-name, next, previous, up
954 @c man begin OPTIONS gkeytool
955 @subsubsection The @option{-certreq} command
957 Use this command to generate a PKCS#10 @i{Certificate Signing Request} (CSR) and write it to a designated output destination. The contents of the destination should look something like the following:
959 @example
960 -----BEGIN NEW CERTIFICATE REQUEST-----
961 MI...QAwXzEUMBIGA1UEAwwLcnNuQGdudS5vcmcxGzAZBgNVBAoMElUg
962 Q2...A0GA1UEBwwGU3lkbmV5MQwwCgYDVQQIDANOU1cxCzAJBgNVBACC
964 FC...IVwNVOfQLRX+O5kAhQ/a4RTZme2L8PnpvgRwrf7Eg8D6w==
965 -----END NEW CERTIFICATE REQUEST-----
966 @end example
968 @b{IMPORTANT}: Some documentation (e.g.@: RSA examples) claims that the @code{Attributes} field, in the CSR is @code{OPTIONAL} while RFC-2986 implies the opposite. This implementation considers this field, by default, as @code{OPTIONAL}, unless the option @option{-attributes} is specified on the command line.
970 @table @gcctabopt
971 @item -alias @var{ALIAS}
972 For more details @pxref{alias,, ALIAS}.
974 @item -sigalg @var{ALGORITHM}
975 The canonical name of the digital signature algorithm to use for signing the certificate. If this option is omitted, a default value will be chosen based on the type of the private key associated with the designated @i{Alias}. If the private key is a @code{DSA} one, the value for the signature algorithm will be @code{SHA1withDSA}. If on the other hand the private key is an @code{RSA} one, then the tool will use @code{MD5withRSA} as the signature algorithm.
977 @item -file @var{FILE}
978 For more details @pxref{file,, FILE}.
980 @item -keypass @var{PASSWORD}
981 Use this option to specify the password which the tool will use to unlock the @i{Key Entry} associated with the designated @i{Alias}.
983 If this option is omitted, the tool will first attempt to unlock the @i{Key Entry} using the same password protecting the key store. If this fails, you will then be prompted to provide a password.
985 @item -storetype @var{STORE_TYPE}
986 For more details @pxref{storetype,, STORE_TYPE}.
988 @item -keystore @var{URL}
989 For more details @pxref{keystore,, URL}.
991 @item -storepass @var{PASSWORD}
992 For more details @pxref{storepass,, PASSWORD}.
994 @item -provider @var{PROVIDER_CLASS_NAME}
995 For more details @pxref{provider,, PROVIDER_CLASS_NAME}.
997 @item -v
998 For more details @pxref{verbose}.
1000 @item -attributes
1001 Use this option to force the tool to encode a @code{NULL} DER value in the CSR as the value of the @code{Attributes} field.
1003 @end table
1004 @c man end
1006 @comment ----------------------------------------------------------------------
1008 @node Command -export, , Command -certreq, Export Commands
1009 @comment node-name, next, previous, up
1010 @c man begin OPTIONS gkeytool
1011 @subsubsection The @option{-export} command
1013 Use this command to export a certificate stored in a key store to a designated output destination, either in binary format (if the @option{-v} option is specified), or in RFC-1421 compliant encoding (if the @option{-rfc} option is specified instead).
1015 @table @gcctabopt
1016 @item -alias @var{ALIAS}
1017 For more details @pxref{alias,, ALIAS}.
1019 @item -file @var{FILE}
1020 For more details @pxref{file,, FILE}.
1022 @item -storetype @var{STORE_TYPE}
1023 For more details @pxref{storetype,, STORE_TYPE}.
1025 @item -keystore @var{URL}
1026 For more details @pxref{keystore,, URL}.
1028 @item -storepass @var{PASSWORD}
1029 For more details @pxref{storepass,, PASSWORD}.
1031 @item -provider @var{PROVIDER_CLASS_NAME}
1032 For more details @pxref{provider,, PROVIDER_CLASS_NAME}.
1034 @item -rfc
1035 Use RFC-1421 specifications when encoding the output.
1037 @item -v
1038 Output the certificate in binary DER encoding. This is the default output format of the command if neither @option{-rfc} nor @code{-v} options were detected on the command line. If both this option and the @option{-rfc} option are detected on the command line, the tool will opt for the RFC-1421 style encoding.
1040 @end table
1041 @c man end
1043 @comment ----------------------------------------------------------------------
1045 @node Display Commands, Management Commands, Export Commands, keytool Tool
1046 @comment node-name, next, previous, up
1047 @c man begin OPTIONS gkeytool
1048 @subsection Display commands
1049 @c man end
1051 @menu
1052 * Command -list::              Display information about one or all Aliases
1053 * Command -printcert::         Print a certificate or a certificate fingerprint
1054 @end menu
1056 @comment ----------------------------------------------------------------------
1058 @node Command -list, Command -printcert, Display Commands, Display Commands
1059 @comment node-name, next, previous, up
1060 @c man begin OPTIONS gkeytool
1061 @subsubsection The @option{-list} command
1063 Use this command to print one or all of a key store entries to @code{STDOUT}. Usually this command will only print a @i{fingerprint} of the certificate, unless either the @option{-rfc} or the @option{-v} option is specified.
1065 @table @gcctabopt
1066 @item -alias @var{ALIAS}
1067 If this option is omitted, the tool will print ALL the entries found in the key store.
1069 For more details @pxref{alias,, ALIAS}.
1071 @item -storetype @var{STORE_TYPE}
1072 For more details @pxref{storetype,, STORE_TYPE}.
1074 @item -keystore @var{URL}
1075 For more details @pxref{keystore,, URL}.
1077 @item -storepass @var{PASSWORD}
1078 For more details @pxref{storepass,, PASSWORD}.
1080 @item -provider @var{PROVIDER_CLASS_NAME}
1081 For more details @pxref{provider,, PROVIDER_CLASS_NAME}.
1083 @item -rfc
1084 Use RFC-1421 specifications when encoding the output.
1086 @item -v
1087 Output the certificate in human-readable format. If both this option and the @option{-rfc} option are detected on the command line, the tool will opt for the human-readable form and will not abort the command.
1089 @end table
1090 @c man end
1092 @comment ----------------------------------------------------------------------
1094 @node Command -printcert, , Command -list, Display Commands
1095 @comment node-name, next, previous, up
1096 @c man begin OPTIONS gkeytool
1097 @subsubsection The @option{-printcert} command
1099 Use this command to read a certificate from a designated input source and print it to @code{STDOUT} in a human-readable form.
1101 @table @gcctabopt
1102 @item -file @var{FILE}
1103 For more details @pxref{file,, FILE}.
1105 @item -v
1106 For more details @pxref{verbose}.
1108 @end table
1109 @c man end
1111 @comment ----------------------------------------------------------------------
1113 @node Management Commands, , Display Commands, keytool Tool
1114 @comment node-name, next, previous, up
1115 @c man begin OPTIONS gkeytool
1116 @subsection Management commands
1117 @c man end
1119 @menu
1120 * Command -keyclone::          Clone a Key Entry in a Key Store
1121 * Command -storepasswd::       Change the password protecting a Key Store
1122 * Command -keypasswd::         Change the password protecting a Key Entry
1123 * Command -delete::            Remove an entry in a Key Store
1124 @end menu
1126 @comment ----------------------------------------------------------------------
1128 @node Command -keyclone, Command -storepasswd, Management Commands, Management Commands
1129 @comment node-name, next, previous, up
1130 @c man begin OPTIONS gkeytool
1131 @subsubsection The @option{-keyclone} command
1133 Use this command to clone an existing @i{Key Entry} and store it under a new (different) @i{Alias} protecting, its private key material with possibly a new password.
1135 @table @gcctabopt
1136 @item -alias @var{ALIAS}
1137 For more details @pxref{alias,, ALIAS}.
1139 @item -dest @var{ALIAS}
1140 Use this option to specify the new @i{Alias} which will be used to identify the cloned copy of the @i{Key Entry}.
1142 @item -keypass @var{PASSWORD}
1143 Use this option to specify the password which the tool will use to unlock the @i{Key Entry} associated with the designated @i{Alias}.
1145 If this option is omitted, the tool will first attempt to unlock the @i{Key Entry} using the same password protecting the key store. If this fails, you will then be prompted to provide a password.
1147 @item -new @var{PASSWORD}
1148 Use this option to specify the password protecting the private key material of the newly cloned copy of the @i{Key Entry}.
1150 @item -storetype @var{STORE_TYPE}
1151 For more details @pxref{storetype,, STORE_TYPE}.
1153 @item -keystore @var{URL}
1154 For more details @pxref{keystore,, URL}.
1156 @item -storepass @var{PASSWORD}
1157 For more details @pxref{storepass,, PASSWORD}.
1159 @item -provider @var{PROVIDER_CLASS_NAME}
1160 For more details @pxref{provider,, PROVIDER_CLASS_NAME}.
1162 @item -v
1163 For more details @pxref{verbose}.
1165 @end table
1166 @c man end
1168 @comment ----------------------------------------------------------------------
1170 @node Command -storepasswd, Command -keypasswd, Command -keyclone, Management Commands
1171 @comment node-name, next, previous, up
1172 @c man begin OPTIONS gkeytool
1173 @subsubsection The @option{-storepasswd} command
1175 Use this command to change the password protecting a key store.
1177 @table @gcctabopt
1178 @item -new @var{PASSWORD}
1179 The new, and different, password which will be used to protect the designated key store.
1181 @item -storetype @var{STORE_TYPE}
1182 For more details @pxref{storetype,, STORE_TYPE}.
1184 @item -keystore @var{URL}
1185 For more details @pxref{keystore,, URL}.
1187 @item -storepass @var{PASSWORD}
1188 For more details @pxref{storepass,, PASSWORD}.
1190 @item -provider @var{PROVIDER_CLASS_NAME}
1191 For more details @pxref{provider,, PROVIDER_CLASS_NAME}.
1193 @item -v
1194 For more details @pxref{verbose}.
1196 @end table
1197 @c man end
1199 @comment ----------------------------------------------------------------------
1201 @node Command -keypasswd, Command -delete, Command -storepasswd, Management Commands
1202 @comment node-name, next, previous, up
1203 @c man begin OPTIONS gkeytool
1204 @subsubsection The @option{-keypasswd} command
1206 Use this command to change the password protecting the private key material of a designated @i{Key Entry}.
1208 @table @gcctabopt
1209 @item -alias @var{ALIAS}
1210 For more details @pxref{alias,, ALIAS}.
1212 Use this option to specify the password which the tool will use to unlock the @i{Key Entry} associated with the designated @i{Alias}.
1214 If this option is omitted, the tool will first attempt to unlock the @i{Key Entry} using the same password protecting the key store. If this fails, you will then be prompted to provide a password.
1216 @item -new @var{PASSWORD}
1217 The new, and different, password which will be used to protect the private key material of the designated @i{Key Entry}.
1219 @item -storetype @var{STORE_TYPE}
1220 For more details @pxref{storetype,, STORE_TYPE}.
1222 @item -keystore @var{URL}
1223 For more details @pxref{keystore,, URL}.
1225 @item -storepass @var{PASSWORD}
1226 For more details @pxref{storepass,, PASSWORD}.
1228 @item -provider @var{PROVIDER_CLASS_NAME}
1229 For more details @pxref{provider,, PROVIDER_CLASS_NAME}.
1231 @item -v
1232 For more details @pxref{verbose}.
1234 @end table
1235 @c man end
1237 @comment ----------------------------------------------------------------------
1239 @node Command -delete, , Command -keypasswd, Management Commands
1240 @comment node-name, next, previous, up
1241 @c man begin OPTIONS gkeytool
1242 @subsubsection The @option{-delete} command
1244 Use this command to delete a designated key store entry.
1246 @table @gcctabopt
1247 @item -alias @var{ALIAS}
1248 For more details @pxref{alias,, ALIAS}.
1250 @item -storetype @var{STORE_TYPE}
1251 For more details @pxref{storetype,, STORE_TYPE}.
1253 @item -keystore @var{URL}
1254 For more details @pxref{keystore,, URL}.
1256 @item -storepass @var{PASSWORD}
1257 For more details @pxref{storepass,, PASSWORD}.
1259 @item -provider @var{PROVIDER_CLASS_NAME}
1260 For more details @pxref{provider,, PROVIDER_CLASS_NAME}.
1262 @item -v
1263 For more details @pxref{verbose}.
1265 @end table
1266 @c man end
1268 @comment ----------------------------------------------------------------------
1270 @node Other Tools, I18N Issues, Security Tools, Top
1271 @comment node-name, next, previous, up
1272 @chapter Other Tools
1274 This is a list of currently undocumented classpath tools: @b{jar},
1275 @b{javah}, @b{gcjh}, @b{native2ascii}, @b{orbd}, @b{serialver}, @b{rmid}, @b{rmiregistry}
1276 and @b{tnameserv}.
1278 @menu
1279 * jar Tool::                   Archive tool for Java archives
1280 * javah Tool::                 A java header compiler
1281 * gcjh Tool::                  A java header compiler (old version)
1282 * native2ascii Tool::          An encoding converter
1283 * orbd Tool::                  An object request broker daemon
1284 * serialver Tool::             A serial version command
1285 * rmid Tool::                  RMI activation daemon
1286 * rmiregistry Tool::           Remote object registry
1287 * tnameserv Tool::             Naming service
1288 * gjdoc Tool::                 A documentation generator
1289 @end menu
1291 @comment ----------------------------------------------------------------------
1293 @node jar Tool, javah Tool, , Other Tools
1294 @comment node-name, next, previous, up
1295 @section The @command{jar} Tool
1296 @c man title gjar - Archive tool for Java archives
1298 @c man begin DESCRIPTION gjar
1300 @command{gjar} is an implementation of Sun's jar utility that comes with
1301 the JDK.
1303 If any file is a directory then it is processed recursively.  The
1304 manifest file name and the archive file name needs to be specified in
1305 the same order the @option{-m} and @option{-f} flags are specified.
1307 @c man end
1309 @ignore
1310 @c man begin SYNOPSIS gjar
1311 gjar @option{-ctxui} [@var{OPTIONS}] @var{jar-file} [@option{-C} @var{DIR} @var{FILE}] @var{FILE}@dots{}
1312 @c man end
1313 @end ignore
1315 @c man begin OPTIONS gjar
1317 Operation mode:
1319 @table @gcctabopt
1320 @item -c
1321 Create new archive.
1323 @item -t
1324 List table of contents for archive.
1326 @item -x
1327 Extract named (or all) files from archive.
1329 @item -u
1330 Update existing archive.
1332 @item -i @var{FILE}
1333 Compute archive index.
1334 @end table
1336 Operation modifiers:
1338 @table @gcctabopt
1339 @item -f @var{FILE}
1340 Specify archive file name.
1342 @item -0
1343 Store only; use no ZIP compression.
1345 @item -v
1346 Generate verbose output on standard output.
1348 @item -M
1349 Do not create a manifest file for the entries.
1351 @item -m @var{manifest}
1352 Include manifest information from specified @var{manifest} file.
1353 @end table
1355 File name selection:
1357 @table @gcctabopt
1358 @item -C @var{DIR} @var{FILE}
1359 Change to the @var{DIR} and include the following @var{FILE}.
1361 @item -@@
1362 Read the names of the files to add to the archive from stdin.  This
1363 option is supported only in combination with @option{-c} or @option{-u}.
1364 Non standard option added in the GCC version.
1365 @end table
1367 Standard options:
1369 @table @gcctabopt
1370 @item -help
1371 Print help text, then exit.
1372 @item -version
1373 Print version number, then exit.
1374 @item -J@var{OPTION}
1375 Pass argument to the Java runtime.
1376 @end table
1378 @c man end
1380 @c man begin SEEALSO gjar
1381 java(1), @dots{}
1382 @c man end
1384 @comment ----------------------------------------------------------------------
1386 @node javah Tool, gcjh Tool, jar Tool, Other Tools
1387 @comment node-name, next, previous, up
1388 @section The @command{javah} Tool
1389 @c man title gjavah - generate header files from Java class files
1391 @c man begin DESCRIPTION gjavah
1393 The @command{gjavah} program is used to generate header files from class
1394 files.  It can generate both CNI and JNI header files, as well as stub
1395 implementation files which can be used as a basis for implementing the
1396 required native methods.
1398 @c man end
1400 @ignore
1401 @c man begin SYNOPSIS gjavah
1402 gjavah @dots{}
1403 @c man end
1404 @end ignore
1406 @c man begin OPTIONS gjavah
1408 @table @gcctabopt
1409 @item -d @var{DIR}
1410 Set output directory.
1412 @item -o @var{FILE}
1413 Set output file (only one of @option{-d} or @option{-o} may be used).
1415 @item -cmdfile @var{FILE}
1416 Read command file.
1418 @item -all @var{DIR}
1419 Operate on all class files under directory @var{DIR}.
1421 @item -stubs
1422 Emit stub implementation.
1424 @item -jni
1425 Emit JNI stubs or header (default).
1427 @item -cni
1428 Emit CNI stubs or header (default JNI).
1430 @item -verbose
1431 Set verbose mode.
1433 @item -force
1434 Output files should always be written.
1435 @end table
1437 Class path options:
1438 @table @gcctabopt
1439 @item -classpath @var{PATH}
1440 Set the class path.
1442 @item -I@var{DIR}
1443 Add directory to class path.
1445 @item -bootclasspath @var{PATH}
1446 Set the boot class path.
1448 @item -extdirs @var{PATH}
1449 Set the extension directory path.
1450 @end table
1452 Standard options:
1453 @table @gcctabopt
1454 @item -help
1455 Print help text, then exit.
1456 @item -version
1457 Print version number, then exit.
1458 @item -J@var{OPTION}
1459 Pass argument to the Java runtime.
1460 @end table
1461 @c man end
1463 @c man begin SEEALSO gjavah
1464 javac(1), @dots{}
1465 @c man end
1467 @comment ----------------------------------------------------------------------
1469 @node gcjh Tool, native2ascii Tool, javah Tool, Other Tools
1470 @comment node-name, next, previous, up
1471 @section The @command{gcjh} Tool
1472 @c man title gcjh - generate header files from Java class files
1474 @c man begin DESCRIPTION gcjh
1476 The @code{gcjh} program is used to generate header files from class
1477 files.  It can generate both CNI and JNI header files, as well as stub
1478 implementation files which can be used as a basis for implementing the
1479 required native methods.  It is similar to @code{javah} but has
1480 slightly different command line options, and defaults to CNI.
1482 @c man end
1484 @ignore
1485 @c man begin SYNOPSIS gcjh
1486 gcjh [@var{OPTIONS}]@dots{} @var{CLASS}@dots{}
1487 @c man end
1488 @end ignore
1490 @c man begin OPTIONS gcjh
1492 See @code{javah} for a full description; this page only lists the
1493 additional options provided by @code{gcjh}.
1495 CNI text options
1496 @table @gcctabopt
1497 @item -add @var{text}
1498 Insert @var{text} into class body.
1499 @item -append @var{text}
1500 Append @var{text} after class declaration.
1501 @item -friend @var{text}
1502 Insert @var{text} as a @code{friend} declaration.
1503 @item -prepend @var{text}
1504 Insert @var{text} before start of class.
1505 @end table
1507 Compatibility options (unused)
1508 @table @gcctabopt
1509 @item -td @var{DIR}
1510 @itemx -M
1511 @itemx -MM
1512 @itemx -MD
1513 @itemx -MMD
1514 Unused compatibility option.
1515 @end table
1518 Standard options:
1519 @table @gcctabopt
1520 @item -help
1521 Print help text, then exit.
1522 @item -version
1523 Print version number, then exit.
1524 @item -J@var{OPTION}
1525 Pass argument to the Java runtime.
1526 @end table
1527 @c man end
1529 @c man begin SEEALSO gcjh
1530 javac(1), javah(1), @dots{}
1531 @c man end
1533 @comment ----------------------------------------------------------------------
1535 @node native2ascii Tool, orbd Tool, gcjh Tool, Other Tools
1536 @comment node-name, next, previous, up
1537 @section The @command{native2ascii} Tool
1538 @c man title gnative2ascii - An encoding converter
1540 @c man begin DESCRIPTION gnative2ascii
1542 To be written @dots{}
1544 @c man end
1546 @ignore
1547 @c man begin SYNOPSIS gnative2ascii
1548 gnative2ascii [@var{OPTIONS}]@dots{} [@var{INPUTFILE} [@var{OUTPUTFILE}]]
1549 @c man end
1550 @end ignore
1552 @c man begin OPTIONS gnative2ascii
1554 @table @gcctabopt
1555 @item -encoding @var{NAME}
1556 Set the encoding to use.
1558 @item -reversed
1559 Convert from encoding to native.
1560 @end table
1562 Standard options:
1563 @table @gcctabopt
1564 @item -help
1565 Print help text, then exit.
1566 @item -version
1567 Print version number, then exit.
1568 @item -J@var{OPTION}
1569 Pass argument to the Java runtime.
1570 @end table
1572 @c man end
1574 @c man begin SEEALSO gnative2ascii
1575 javac(1), @dots{}
1576 @c man end
1578 @comment ----------------------------------------------------------------------
1580 @node orbd Tool, serialver Tool, native2ascii Tool, Other Tools
1581 @comment node-name, next, previous, up
1582 @section The @command{orbd} object request broker daemon
1583 @c man title gorbd - An object request broker daemon
1585 @c man begin DESCRIPTION gorbd
1587 To be written @dots{}
1589 @c man end
1591 @ignore
1592 @c man begin SYNOPSIS gorbd
1593 gorbd @dots{}
1594 @c man end
1595 @end ignore
1597 @c man begin OPTIONS gorbd
1599 @table @gcctabopt
1600 @item -ORBInitialPort @var{PORT}
1601 Port on which persistent naming service is to be started.
1603 @item -ior @var{FILE}
1604 File in which to store persistent naming service's IOR reference
1606 @item -directory @var{DIR}
1607 Directory in which to store persistent data.
1609 @item -restart
1610 Restart persistent naming service, clearing persistent naming
1611 database.
1612 @end table
1614 Standard options:
1615 @table @gcctabopt
1616 @item -help
1617 Print help text, then exit.
1618 @item -version
1619 Print version number, then exit.
1620 @item -J@var{OPTION}
1621 Pass argument to the Java runtime.
1622 @end table
1624 @c man end
1626 @c man begin SEEALSO gorbd
1627 java(1), @dots{}
1628 @c man end
1630 @comment ----------------------------------------------------------------------
1632 @node serialver Tool, rmid Tool, orbd Tool, Other Tools
1633 @comment node-name, next, previous, up
1634 @section The @command{serialver} version command
1635 @c man title gserialver version command
1637 @c man begin DESCRIPTION gserialver
1639 Print the serialVersionUID of the specified classes.
1641 @c man end
1643 @ignore
1644 @c man begin SYNOPSIS gserialver
1645 gserialver [@var{OPTIONS}]@dots{} @var{CLASS}@dots{}
1646 @c man end
1647 @end ignore
1649 @c man begin OPTIONS gserialver
1651 @table @gcctabopt
1652 @item -classpath @var{PATH}
1653 Class path to use to find classes.
1654 @end table
1656 Standard options:
1657 @table @gcctabopt
1658 @item -help
1659 Print help text, then exit.
1660 @item -version
1661 Print version number, then exit.
1662 @item -J@var{OPTION}
1663 Pass argument to the Java runtime.
1664 @end table
1666 @c man end
1668 @c man begin SEEALSO gserialver
1669 javac(1), @dots{}
1670 @c man end
1672 @comment ----------------------------------------------------------------------
1674 @node rmid Tool, rmiregistry Tool, serialver Tool, Other Tools
1675 @comment node-name, next, previous, up
1676 @section The @command{rmid} RMI activation system daemon
1677 @c man title grmid - RMI activation system daemon
1679 @c man begin DESCRIPTION grmid
1681 @command{rmiregistry} starts a remote object registry on the current
1682 host.  If no port number is specified, then port 1099 is used.
1684 @c man end
1686 @ignore
1687 @c man begin SYNOPSIS grmid
1688 grmid [@var{OPTIONS}]@dots{}
1689 @c man end
1690 @end ignore
1692 @c man begin OPTIONS grmid
1694 Activation process control:
1695 @table @gcctabopt
1696 @item -port @var{PORT}
1697 Port on which activation system is to be started.
1699 @item -restart
1700 Restart activation system, clearing persistent naming database, if
1701 any.
1703 @item -stop
1704 Stop activation system.
1705 @end table
1707 Persistence:
1708 @table @gcctabopt
1709 @item -persistent
1710 Make activation system persistent.
1712 @item -directory @var{DIR}
1713 Directory in which to store persistent data.
1714 @end table
1716 Debugging:
1717 @table @gcctabopt
1718 @item -verbose
1719 Log binding events to standard out.
1720 @end table
1722 Standard options:
1723 @table @gcctabopt
1724 @item -help
1725 Print help text, then exit.
1726 @item -version
1727 Print version number, then exit.
1728 @item -J@var{OPTION}
1729 Pass argument to the Java runtime.
1730 @end table
1732 @c man end
1734 @c man begin SEEALSO grmid
1735 java(1), @dots{}
1736 @c man end
1738 @comment ----------------------------------------------------------------------
1740 @node rmiregistry Tool, tnameserv Tool, rmid Tool, Other Tools
1741 @comment node-name, next, previous, up
1742 @section The @command{rmiregistry} Tool
1743 @c man title grmiregistry - Remote object registry
1745 @c man begin DESCRIPTION grmiregistry
1747 @command{grmiregistry} starts a remote object registry on the current
1748 host.  If no port number is specified, then port 1099 is used.
1750 @c man end
1752 @ignore
1753 @c man begin SYNOPSIS grmiregistry
1754 grmiregistry [@var{OPTIONS}]@dots{} @var{PORT}
1755 @c man end
1756 @end ignore
1758 @c man begin OPTIONS grmiregistry
1760 Registry process control:
1761 @table @gcctabopt
1762 @item -restart
1763 Restart RMI naming service, clearing persistent naming database, if
1764 any.
1766 @item -stop
1767 Stop RMI naming service.
1768 @end table
1770 Persistence:
1771 @table @gcctabopt
1772 @item -persistent
1773 Make RMI naming service persistent.
1775 @item -directory @var{DIR}
1776 Directory in which to store persistent data.
1777 @end table
1779 Debugging:
1780 @table @gcctabopt
1781 @item -verbose
1782 Log binding events to standard out.
1783 @end table
1785 Standard options:
1786 @table @gcctabopt
1787 @item -help
1788 Print help text, then exit.
1789 @item -version
1790 Print version number, then exit.
1791 @item -J@var{OPTION}
1792 Pass argument to the Java runtime.
1793 @end table
1795 @c man end
1797 @c man begin SEEALSO grmiregistry
1798 java(1), @dots{}
1799 @c man end
1801 @comment ----------------------------------------------------------------------
1803 @node tnameserv Tool, gjdoc Tool, rmiregistry Tool, Other Tools
1804 @comment node-name, next, previous, up
1805 @section The @command{tnameserv} Tool
1806 @c man title gtnameserv Naming service
1808 @c man begin DESCRIPTION gtnameserv
1810 To be written @dots{}
1812 @c man end
1814 @ignore
1815 @c man begin SYNOPSIS gtnameserv
1816 tnameserv [@var{OPTIONS}]
1817 @c man end
1818 @end ignore
1820 @c man begin OPTIONS gtnameserv
1822 @table @gcctabopt
1823 @item -ORBInitialPort @var{PORT}
1824 Port on which naming service is to be started.
1826 @item -ior @var{FILE}
1827 File in which to store naming service's IOR reference.
1828 @end table
1830 Standard options:
1831 @table @gcctabopt
1832 @item -help
1833 Print help text, then exit.
1834 @item -version
1835 Print version number, then exit.
1836 @item -J@var{OPTION}
1837 Pass argument to the Java runtime.
1838 @end table
1840 @c man end
1842 @c man begin SEEALSO gtnameserv
1843 java(1), @dots{}
1844 @c man end
1846 @comment ----------------------------------------------------------------------
1848 @ignore
1849 @c man begin SYNOPSIS gjdoc
1850 gjdoc [@option{-sourcepath }@var{pathlist}]
1851       [@option{-all}] [@option{-subpackages }@var{pkg:pkg:@dots{}}] [@option{-exclude }@var{pkglist}]
1852       [@option{-encoding }@var{charset}] [@option{-locale }@var{name}] [@option{-source }@var{release}]
1853       [@option{-public}] [@option{-protected}] [@option{-package}] [@option{-private}] 
1854       [@option{-doctitle }@var{text}] [@option{-header }@var{text}] [@option{-footer }@var{text}] [@option{-bottom }@var{text}]
1855       [@option{-link }@var{url}] [@option{-linkoffline }@var{url} @var{path}] [@option{-noqualifier }@var{pkg:pkg:@dots{}}] 
1856       [@option{-tagletpath }@var{pathlist}] [@option{-taglet }@var{className}] [@option{-tag }@var{tagspec}]
1857       [@option{-use}] [@option{-linksource}] [@option{-splitindex}] [@option{-noindex}] [@option{-notree}] 
1858       [@option{-version}] [@option{-author}] [@option{-nosince}] [@option{-addstylesheet }@var{file}]
1859       [@option{-d }@var{targetdir}] 
1860       [@var{packages}@dots{}] [@var{sourcefiles}@dots{}] [@@@var{cmdfile}]
1862 gjdoc [@option{-sourcepath }@var{pathlist}]
1863       [@option{-all}] [@option{-subpackages }@var{pkg:pkg:@dots{}}] [@option{-exclude }@var{pkglist}]
1864       [@option{-encoding }@var{charset}] [@option{-locale }@var{name}] [@option{-source }@var{release}]
1865       [@option{-public}] [@option{-protected}] [@option{-package}] [@option{-private}] 
1866       [@option{-docletpath }@var{pathlist}] [@option{-doclet }@var{className}]
1867       [@var{packages}@dots{}] [@var{sourcefiles}@dots{}] [@@@var{cmdfile}]
1868       [doclet options]
1870 gjdoc @option{--help}
1872 gjdoc @option{--version}
1874 Only the most useful options are listed here; see below for the
1875 remainder.
1876 @c man end
1877 @end ignore
1878 @c man begin SEEALSO gjdoc
1879 Info entry for @file{gjdoc}.
1880 @c man end
1881 @c man begin BUGS gjdoc
1882 Please report bugs to @w{@uref{http://savannah.gnu.org/bugs/?group=classpath}}.
1883 @c man end
1884 @c man begin AUTHOR gjdoc
1885 Julian Scheid
1886 @c man end
1888 @node gjdoc Tool, , tnameserv Tool, Other Tools
1889 @chapter Generating HTML Documentation
1890 @cindex Gjdoc command options
1891 @cindex command options
1892 @cindex options, Gjdoc command
1894 @c man begin DESCRIPTION gjdoc
1895 Gjdoc can be used in two ways: as a stand-alone documentation tool, or
1896 as a driver for a user-specified Doclet. @xref{Other Doclets}.
1898 In the default mode, Gjdoc will use the Standard Doclet
1899 @samp{HtmlDoclet} to generate a set of HTML pages.  The canonical
1900 usage is:
1902 @smallexample
1903 gjdoc -s src/java/ -all -d api-docs/
1904 @end smallexample
1906 Here, @samp{src/java/} is the root of your source code class
1907 hierarchy, @option{-all} means that all valid Java files found under
1908 this root directory should be processed, and @samp{api-docs/} is the
1909 directory where the generated documentation should be placed.
1911 To learn more about running Doclets other than the Standard Doclet,
1912 refer to the manual.  @xref{Invoking a Custom Doclet}.
1914 @menu
1915 * Invoking the Standard Doclet::   How to generate HTML documentation.
1916 * Invoking a Custom Doclet::       How to run third-party and other 
1917                                    built-in Doclets.
1919 * Option Summary by Type::         Brief list of all options, grouped by type.
1920 * Gjdoc Option Summary::           List of all options accepted by Gjdoc.
1922 * Source Set Options::      Select the set of source codes to run Gjdoc on.
1923 * Source Format Options::   Specify the format of the source codes to document.
1925 * Interlinking Options::    Connection your documentation with other projects.
1926 * Output Control Options::  Specify the target directory and locale, and more.
1927 * Generation Options::       Select which pieces of information to generate.
1928 * Decoration Options::      Add or modify some titles, headers and footers or
1929                               override/amend static resources like stylesheets.
1930 * Taglet Options::          Define your own javadoc @@tags
1932 * Virtual Machine Options::
1933 * Verbosity Options::
1934 * Doclet Options::
1936 * Other Doclets::                  Generating Other Output Types
1937 * Gjdoc Concepts::                 Advanced Concepts
1939 @end menu
1941 @c man end
1943 @comment ----------------------------------------------------------------------
1945 @node Invoking the Standard Doclet, Invoking a Custom Doclet, , gjdoc Tool
1946 @section Invoking the Standard Doclet
1947 @cindex Gjdoc command options
1948 @cindex command options
1949 @cindex options, Gjdoc command
1951 Running the Gjdoc Standard Doclet @samp{HtmlDoclet} is the default
1952 mode of operation for Gjdoc.  This section lists the command line
1953 options you can specify in this mode.  It doesn't distinguish between
1954 general Gjdoc options and options specific to the Standard Doclet.
1956 If you want to learn which options are accepted when Gjdoc is used as
1957 a doclet driver, @xref{Invoking a Custom Doclet}.
1959 @menu
1960 * Source Set Options::      Select the set of source codes to run Gjdoc on.
1961 * Source Format Options::   Specify the format of the source codes to document.
1963 * Output Control Options::  Specify the target directory and locale, and more.
1964 * Generation Options::       Select which pieces of information to generate.
1965 * Decoration Options::      Add or modify some titles, headers and footers or
1966                               override/amend static resources like stylesheets.
1967 * Taglet Options::          Define your own javadoc @@tags
1969 * Virtual Machine Options::
1970 * Doclet Options::
1972 @end menu
1974 @c man begin OPTIONS gjdoc
1976 @node Option Summary by Type, Gjdoc Option Summary, Invoking a Custom Doclet, gjdoc Tool
1977 @section Option Summary by Type
1979 Here is a summary of all the options of both Gjdoc and the Standard
1980 Doclet, grouped by type.  Explanations are in the following sections.
1982 @table @emph
1983 @item Source Set Options
1984 @xref{Source Set Options,,Options For Specifying the Source Files To Operate on}.
1985 @gccoptlist{-sourcepath @var{pathlist}  -subpackages @var{pkglist}  -exclude @var{pkglist}}
1987 @item Source Format Options
1988 @xref{Source Format Options,,Options For Specifying the Source Format}.
1989 @gccoptlist{-source @var{release}  -encoding @var{encoding}  -breakiterator}
1991 @item Interlinking Options
1992 @xref{Interlinking Options,,Options For Specifying the Source Files To Operate on}.
1993 @gccoptlist{-link @var{url}  -linkoffline @var{url} @var{file}  -noqualifier @var{pkg:pkg:...}}
1995 @item Generation Options
1996 @xref{Generation Options,,Options Controlling What is Included in the Output}.
1997 @gccoptlist{-author  -licensetext  -use  -version  -splitindex  -noindex
1998  -nodeprecated  -nodeprecatedlist  -nohelp  -nonavbar
1999  -nosince  -notree  -public  -protected  -package  -private
2000  -docfilessubdirs  -excludedocfilessubdir @var{dirname}
2001  -linksource}
2003 @item Output Options
2004 @xref{Generation Options,,Options Controlling the Output}.
2005 @gccoptlist{-d  -locale @var{name}  -charset @var{charset}  -docencoding @var{charset}
2006  -validhtml  -baseurl @var{url}}
2008 @item Decoration Options
2009 @gccoptlist{-windowtitle @var{text}  -doctitle @var{text}  -title @var{text}  
2010  -header @var{text}  -footer @var{text}  -bottom @var{text}
2011  -helpfile @var{file}  -stylesheetfile @var{file}  -addstylesheet @var{file}
2012  -group @var{groupheading} @var{pkgpattern:pkgpattern:@dots{}}}
2014 @item Taglet Options
2015 @xref{Taglet Options,,Options For Specifying user-defined Taglets}.
2016 @gccoptlist{-tagletpath  -taglet @var{classname}  -tag @var{tagspec}}
2018 @item Doclet Options
2019 @xref{Doclet Options,,Options For Specifying the Doclet to use}.
2020 @gccoptlist{-docletpath  -doclet @var{classname}}
2022 @item Verbosity Options
2023 @xref{Verbosity Options,,Options Controlling Gjdoc Behavior}.
2024 @gccoptlist{-quiet  -verbose}
2026 @item Virtual Machine Options
2027 @xref{Virtual Machine Options,,Options Controlling Gjdoc Behavior}.
2028 @gccoptlist{-classpath  -bootclasspath  -J @var{vmopt}}
2030 @end table
2032 @menu
2033 * Virtual Machine Options::     Controlling the kind of output:
2034                         an executable, object files, assembler files,
2035                         or preprocessed source.
2036 @end menu
2038 @node Source Set Options, Source Format Options, Gjdoc Option Summary, gjdoc Tool
2039 @section Selecting which Source Files to Process
2041 @table @gcctabopt
2042 @item -s @var{pathlist}
2043 @item -sourcepath @var{pathlist}
2044 Look for source files in the specified directory or directories.
2046 @var{pathlist} should be one or more directory paths separated by your
2047 platform's path separator (usually @samp{:} or @samp{;}).
2049 If this option is not given, @command{gjdoc} will look for source
2050 files in the current directory.
2052 The directories specified should be root directories in terms of the
2053 Java package system.  For example, if you want to generate
2054 documentation for classes in package @samp{foo.bar}, you must specify
2055 the directory containing the top-level @samp{@file{foo}}
2056 sub-directory, not the directory @samp{@file{foo/bar/}} in which the
2057 Java source files reside.
2059 The short-hand alias @option{-s} is specific to @command{gjdoc} and
2060 not compatible to Sun @command{javadoc}.
2062 @item -all
2063 @emph{[EXPERIMENTAL]}
2064 Process all valid Java source files found in the directories listed in
2065 the source path and their sub-directories.
2067 This is an option specific to @command{gjdoc} and not compatible to
2068 Sun @command{javadoc}.
2070 @item -subpackages @var{pkg:pkg:@dots{}}
2071 Process the classes in the given Java packages and all sub-packages,
2072 recursively.  Note that multiple package names must be separated with
2073 colons instead of whitespace.
2075 @item -exclude @var{pkg:pkg:@dots{}}
2076 Do not process classes in the given Java packages and all
2077 sub-packages, recursively.  This option can be used in conjunction
2078 with @option{-all} or @option{-subpackages} in order to exclude
2079 individual packages or package sub-trees from the output.
2081 @item @var{packages}@dots{}
2082 Process all classes in the given Java packages.
2084 @item @var{sourcefiles}@dots{}
2085 Process the classes in the given Java source files.
2086 @end table
2088 @node Source Format Options, Interlinking Options, Source Set Options, gjdoc Tool
2089 @section Specifying the Format of Input Files
2091 @table @gcctabopt
2092 @item -source @var{release}
2093 Assume that the source files are targeted at the given release of the
2094 Java platform.
2096 @var{release} should be the version number of a Java platform release
2097 in the format MAJOR.MINOR, for example @samp{1.4}.
2099 This option is currently ignored except that an error is raised if a
2100 release number other than @samp{1.2}, @samp{1.3} or @samp{1.4} is
2101 specified.
2103 @item -encoding @var{charset}
2104 Assume that the source files are encoded using @var{charset}.
2106 Examples for @var{charset} are @samp{US-ASCII}, @samp{ISO-8859-1} or
2107 @samp{UTF-8}.
2109 The semantics of @var{charset} are identical to those of @samp{java.nio.charset.Charset.forName(String)}.
2111 @item -breakiterator
2112 Use the locale's java.text.BreakIterator instead of the internal
2113 first sentence detector.
2115 By default, @command{gjdoc} uses an internal algorithm to determine
2116 where a sentence ends. When this option is given, it will instead use
2117 the @samp{java.text.BreakIterator} instance for the locale given with
2118 @option{-locale} (or the default locale).
2120 This option should be specified when applying @command{gjdoc} to
2121 source code commented in a non-latin language for which the default
2122 first sentence detector does not work. For all other cases, the
2123 default (do not use BreakIterator) produces better results at the time
2124 of this writing.
2125 @end table
2127 @node Interlinking Options, Output Control Options, Source Format Options, gjdoc Tool
2128 @section Interlinking with other Documentation Sets
2130 @table @gcctabopt
2131 @item -link @var{url}
2133 Create hyperlinks to another documentation set.
2135 By default, @command{gjdoc} will only create hyperlinks to classes in
2136 the source set.  Use this option to additionally create hyperlinks to
2137 classes covered by the specified documentation set.
2139 @var{url} should be the root URL of the other documentation set. For
2140 example, to add hyperlinks to GNU Classpath, specify the following:
2142 @smallexample
2143 -link http://developer.classpath.org/doc/
2144 @end smallexample
2146 The @option{-link} option can be specified multiple times.
2148 Note that specifying the @option{-link} option will cause an HTTP
2149 access every time gjdoc is invoked. You can use @option{-linkoffline}
2150 instead to avoid this access.
2152 @item -linkoffline @var{url} @var{file}
2154 Create hyperlinks to another documentation set which is also present
2155 on the local file system.
2157 This option works exactly like @option{-link}, except that it accesses
2158 the local file system instead of the network for determining which
2159 classes are covered by the linked documentation set.
2161 When using @option{-linkoffline} the remote documentation set is not
2162 accessed at all, which can significantly speed up generation time
2163 depending on your network connection.  The generated hyperlinks to the
2164 documentation set however refer to the remote set, not to the local
2165 one, so that you can distribute the documentation without any further
2166 dependencies.
2168 The @option{-linkoffline} option can be specified multiple times.
2170 @item -noqualifier @var{pkg:pkg:@dots{}}
2172 Do not qualify names of classes in the given packages with their
2173 package name.
2175 By default, a class name is displayed unqualified only if the class is
2176 part of the source set or a linked documentation set, and qualified
2177 with the name of its containing package if it is not. You can use this
2178 option to force unqualified names for classes even if they are not
2179 part of the documentation set.
2181 For example, usually a reference to the String class is represented
2182 fully-qualified as @samp{java.lang.String} (unless you link to the
2183 appropriate documentation set using @option{-link}) because it isn't
2184 part of the documentation set.  You can specify @samp{-noqualifier
2185 java.lang} to render the same references just as @samp{String}.
2187 Note that for all unqualified class names, a tooltip is provided when
2188 you place your mouse pointer over it in the HTML documentation.
2190 @item -noqualifier @samp{all}
2191 Omit package name qualifier from all class names.
2193 Specify this option to omit package name qualifiers altogether,
2195 @end table
2197 @node Generation Options, Decoration Options, Output Control Options, gjdoc Tool
2198 @section Selecting which Information to Generate
2200 @table @gcctabopt
2201 @item -public
2202 Only include public members of public classes in the output.  By
2203 default, protected class members are included as well.
2205 @item -protected
2207 Include public or protected members of public classes in the output.
2208 This is the default.
2210 @item -package
2212 Include public, protected and package-private members of public and
2213 package-private classes.
2215 @item -private
2217 Include all classes and class members regardless of their access
2218 level.
2220 @item -splitindex
2221 Generate one index page per letter instead of a single, monolithic
2222 index page.
2224 By default, the index created by the Standard Doclet contains all
2225 entries on a single page.  This is fine for small documentation sets,
2226 but for large sets you should specify this option.
2228 @item -nosince
2229 Ignore @samp{@@since} tags in javadoc comments.
2231 By default, the generated output contains sections listing the version
2232 of your API since which the package, class or class member in question
2233 exists when this tag is encountered.  Specify this option to omit this
2234 information.
2236 @item -notree
2237 Do not generate any tree pages.
2239 By default, the generated output includes one inheritance tree per
2240 package, and - if the documentation set consists of multiple packages
2241 - a page with the full inheritance tree.  Specify this option to omit
2242 generation of these pages.
2244 @item -noindex
2245 Do not output the alphabetical index.
2247 By default, gjdoc generates an alphabetical index of all program
2248 elements in the documentation set (packages, classes, inner classes,
2249 constructors, methods, and fields).  Specify this option to omit this
2250 information.
2252 @item -nohelp
2253 Do not generate the help page.
2255 This option is currently ignored as the Standard Doclet doesn't
2256 provide a help page.
2258 @item -nodeprecated
2259 Do not output inline information about deprecated packages, classes or
2260 class members.
2262 By default, the Standard Doclet adds a highlighted paragraph with
2263 deprecation information to the description of each deprecated program
2264 element.  Specify this option to omit this information.
2266 @item -nodeprecatedlist
2267 Do not output the summary page for deprecated API elements.
2269 By default, the Standard Doclet generates a page listing all
2270 deprecated API elements along with a deprecation description which
2271 usually includes the reason for deprecation and possible
2272 alternatives.  Specify this option to omit this information.
2274 @item -nonavbar
2275 Do not output the navigation bar, header, and footer.
2277 By default, each output page is equipped with a top navigation bar
2278 (which may include a user-specified header) and a bottom navigation
2279 bar (which may include a user-specified footer).  Specify this option
2280 to omit this decoration.
2282 @item -nocomment
2284 Omit all documentation text from the generated files and output only
2285 declarations and program element relationships.
2287 This option is here for compatibility with @command{javadoc}.  If you
2288 plan on extracting information about your project via @command{gjdoc},
2289 you should consider using a different Doclet for your purposes
2290 instead, for example XmlDoclet.  You could also use the Doclet API
2291 directly by implementing a new Doclet.
2293 @item -linksource
2295 Generate a page with syntax-highlighted source code for each class.
2296 By default, this page is not generated.
2298 The source code can be accessed by clicking on the button labelled
2299 "Source" in the navigation bar, or by clicking on the name of a
2300 constructor, field, method, or inner class in the detail section of a
2301 class documentation page.
2303 @item -use
2305 Generate a page with cross-reference information. By default, this
2306 page is not generated.
2308 The cross-reference information can be accessed by clicking on the
2309 button labelled `Use' in the navigation bar.
2311 The `Use' page lists all classes/interfaces in the documentation set
2312 that extend/implement the class (type) in question; fields of the
2313 type; methods or constructors accepting a parameter of the type;
2314 methods returning the type; and methods or constructors throwing the
2315 type.
2317 @item -author
2318 Include author information in the output.
2320 When specified, author information as specified using the
2321 @samp{@@author} tag in javadoc comments is incorporated into the
2322 output. By default, @samp{@@author} tags are ignored.
2324 @item -version
2325 Include version information in the output.
2327 When specified, version information as specified using the
2328 @samp{@@version} tag in javadoc comments is incorporated into the
2329 output. By default, @samp{@@version} tags are ignored.
2331 @item -licensetext
2333 Assume that the first comment in each source file contains the license
2334 text, and add license information to the footer of each generated
2335 class page.
2337 This is an option specific to @command{gjdoc} and not compatible to
2338 Sun @command{javadoc}.
2340 This option is intended for use with free and open source projects
2341 where source code is typically prefixed with a boilerplate license
2342 comment, when there are legal reasons for including the license in the
2343 documentation.
2345 @item -docfilessubdirs
2347 Recursively copy all files in the @file{doc-files} sub-directory of each
2348 package directory.
2350 Usually, only the files in the @file{doc-files} sub-directory are copied
2351 without descending recursively.
2353 @xref{Adding Custom Resources}.
2355 @item -excludedocfilessubdir @var{name}:@var{name}:@dots{}
2357 Do not copy some directories directly under the @file{doc-files}
2358 sub-directories when descending recursively.
2360 The argument to this option should be a colon-separated list of
2361 directory names.
2363 This option only makes sense if @option{-docfilessubdirs} is also
2364 specified.  In this case, any sub-directory located directly beneath a
2365 @file{doc-files} directory is omitted if listed.
2367 @end table
2369 @node Taglet Options, Virtual Machine Options, Decoration Options, gjdoc Tool
2370 @section Custom Documentation Tags
2372 @table @gcctabopt
2373 @item -tagletpath @var{pathlist}
2374 Search @var{pathlist} when loading subsequent Taglet classes specified
2375 using @option{-taglet}.
2377 @var{pathlist} should be one or more paths to a directory or jar file,
2378 separated by your platform's path separator (usually @samp{:} or
2379 @samp{;}).
2381 @item -taglet @var{classname}
2382 Register a Taglet.
2384 @var{classname} should be the fully-qualified name of a Java class
2385 implementing @samp{com.sun.tools.doclets.Taglet}.
2387 The Taglet classes will be loaded from the classpath specified using
2388 @option{-tagletpath}, from the classpath specified using
2389 @option{-classpath} and from the default classpath.
2391 See the documentation of @samp{com.sun.tools.doclets.Taglet} for
2392 further information.
2394 Note that for simple tags, there is also @option{-tag}.
2396 @item -tag @var{tagspec}
2397 Register a generic Taglet.
2399 The format of @var{tagspec} must be @samp{<tagname>:<flags>:"<taghead>"}.
2401 @var{tagname} is the tag name to match, without the leading @@ sign. 
2403 @var{flags} is one or more of the following characters, where each
2404 character specifies a source code context in which the tag is to be
2405 recognized.
2407 @table @gcctabopt
2408 @item a  
2409 all contexts
2410 @item c  
2411 constructors
2412 @item f  
2413 fields
2414 @item m  
2415 methods
2416 @item o  
2417 overview
2418 @item p  
2419 packages
2420 @item t  
2421 types (classes, interfaces, exceptions, errors)
2422 @item X  
2423 special character which temporarily disables the
2424 Taglet altogether.
2425 @end table
2427 @var{taghead} is the string to display in the header of the section
2428 devoted to the tag in question.
2430 For example, to define a tag matching @samp{@@cvsid} which is to be
2431 accepted in overview, package and type pages and which is labelled
2432 with the header @samp{CVS ID}, you would specify:
2434 @smallexample
2435 -tag cvsid:tpo:"CVS ID"
2436 @end smallexample
2438 Let's say that a class javadoc comment contains
2440 @smallexample
2441 @@cvsid $Id: cp-tools.texinfo,v 1.9 2012-03-07 15:27:27 gnu_andrew Exp $
2442 @end smallexample
2444 Then the HTML output will contain something like
2446 @smallexample
2447 CVS ID:
2448   $Id: cp-tools.texinfo,v 1.9 2012-03-07 15:27:27 gnu_andrew Exp $
2449 @end smallexample
2450 @end table
2452 @node Doclet Options, Other Doclets, Verbosity Options, gjdoc Tool
2453 @section Running Other Doclets
2455 @table @gcctabopt
2457 @item -docletpath @var{pathlist}
2458 Search @var{pathlist} when loading classes for the Doclet specified
2459 using @option{-doclet}.
2461 @var{pathlist} should be one or more paths to a directory or jar file,
2462 separated by your platform's path separator (usually @samp{:} or
2463 @samp{;}).
2465 @item -doclet @var{className}
2466 Run the specified doclet instead of the standard HtmlDoclet.
2468 @var{className} should be the fully-qualified name of a class which
2469 has a public default constructor and contain a method with the
2470 following signature:
2472 @smallexample
2473    import com.sun.javadoc.RootDoc;
2474    public static boolean start(RootDoc rootDoc) 
2475 @end smallexample
2477 The Doclet classes will be loaded from the classpath specified using
2478 @option{-docletpath}, from the classpath specified using
2479 @option{-classpath} and from the default classpath.
2481 The @samp{start} method should process the information exposed by the
2482 Doclet API via @samp{rootDoc} and return @samp{true} on success,
2483 @samp{false} on failure.
2485 If you are using a third-party doclet, refer to its documentation for
2486 further instructions.  Note that support for third-party doclets is
2487 experimental.  Please report any problems you encounter, or provide
2488 feedback when successfully running third-party applets.
2490 This option can be specified multiple times, in which case all doclets
2491 are executed with the same information tree exposed via the Doclet API
2492 for each Doclet run.
2494 @end table
2496 @node Decoration Options, Taglet Options, Generation Options, gjdoc Tool
2497 @section Adding Information to the Output
2499 @table @gcctabopt
2500 @item -windowtitle @var{text}
2501 Use @var{text} as the browser window title prefix.
2503 When specified, the browser window title for each page will be
2504 prefixed with @var{text} instead of the default string @samp{Generated
2505 API Documentation}.
2507 @var{text} should be plain text (it should not contain HTML tags).
2509 @item -doctitle @var{text}
2510 Set the header text of the overview page to @var{text}.
2512 @var{text} should be a short plain text string.
2514 When generating documentation for a single package, specifying this
2515 option forces generation of the overview page.
2517 @item -header @var{htmltext}
2519 Add @var{htmltext} to the right upper corner of every generated page.
2520 @var{htmltext} is usually set to the name of the project being
2521 documented.
2523 @item -footer @var{htmltext}
2525 Add @var{htmltext} to the right bottom corner of every generated page.
2526 @var{htmltext} is often set to the same value as for @option{-header}.
2528 @item -bottom @var{htmltext}
2530 Add @var{htmltext} to the very bottom of every generated page,
2531 spanning the whole width of the page.  When specified, @var{htmltext}
2532 usually consists of a copyright notice and/or links to other project
2533 pages.
2535 @item -addstylesheet @var{file}
2537 Augment the default CSS style sheets with the user-specified
2538 stylesheet @var{file}.
2540 The given stylesheet is simply loaded by each HTML page in addition to
2541 the default ones, as the last stylesheet.
2543 Note that the CSS cascading rules apply.  That is, your style
2544 properties will only be assigned if they have a higher cascading order
2545 than @command{gjdoc}'s default style.  One simple way to make sure
2546 that this is the case is to declare your overrides @samp{!important}.
2548 See @w{@uref{http://www.w3.org/TR/REC-CSS2/cascade.html#cascading-order}}.
2550 @item -group @var{heading} @var{pkgwildcard}:@var{pkgwildcard}:@dots{}
2552 Arrange the given packages in a separate group on the overview page.
2554 The first argument should be a short plain text which is used as the
2555 title of the package group.  The second argument should be a
2556 colon-separated list of package wildcards.  The group will consist of
2557 all packages in the documentation set whose name matches any of the
2558 given wildcards.
2560 There is only one wildcard character, @samp{*}, which matches both
2561 letters in package name components and the @samp{.} separating package
2562 name components.  For example, @samp{j*regex} would match package
2563 @samp{java.util.regex}.  A more useful example would be
2564 @samp{javax.swing*} to match @samp{javax.swing} and all of its
2565 sub-packages.
2567 This option can be given multiple times.  
2569 FIXME: Information about group nesting here.
2571 @smallexample
2572 gjdoc -group "Core Classes" 'java*' \
2573       -group "Swing" 'javax.swing*' \
2574       -group "XML APIs" 'javax.xml*' \
2575       -group "Other Extensions" javax* \
2576       @dots{}
2577 @end smallexample
2579 @item -overview @var{file}
2581 Add the XHTML body fragment from @var{file} to the overview page.
2583 @var{file} should contain an XHTML fragment with the HTML @samp{body}
2584 tag as the root node.  @xref{XHTML Fragments}.
2586 This option can be used to supply a description of the documentation
2587 set as a whole.
2589 When specified, the first sentence of the fragment will be put above
2590 the tables listing the documented packages, along with a link to the
2591 full copy of the fragment which is put below the tables.
2592 @xref{First Sentence Detector}.
2594 When generating documentation for a single package, specifying this
2595 option forces generation of the overview page.
2597 @item -stylesheetfile @var{file}
2599 Use the CSS stylesheet in @var{file} instead of the default CSS
2600 stylesheets.
2602 If you only want to override parts of the default stylesheets, use
2603 @option{-addstylesheet} instead.
2605 @item -title @var{text}
2607 @emph{Deprecated.} Use @option{-doctitle} @var{text} instead.
2609 @item -helpfile @var{file}
2611 This option is currently ignored.
2613 When implemented, it will use the XHTML fragment in @var{file} for the
2614 help page contents instead of the default help text.
2616 @end table
2618 @node Output Control Options, Generation Options, Interlinking Options, gjdoc Tool
2619 @section Controlling the Output.
2621 @table @gcctabopt
2622 @item -d @var{directory}
2623 Place all output files into @var{directory} (and
2624 sub-directories). @var{directory} will be created if it does not
2625 exist, including all non-existing parent directories and all required
2626 sub-directories.
2628 If not specified, output will be placed into the current directory.
2630 @item -locale @var{name}
2632 Use locale @var{name} instead of the default locale for all purposes.
2634 @var{name} should be a locale specifier in the form @samp{ll_CC[_VAR]}
2635 where @samp{ll} is a lowercase two-letter ISO-639 language code,
2636 @samp{CC} is an optional uppercase two-letter ISO-3166 country code,
2637 and @samp{VAR} is an optional variant code.  For example, @samp{en}
2638 specifies English, @samp{en_US} specifies US English, and
2639 @samp{en_US_WIN} specifies a deviant variant of the US English locale.
2641 Note that the semantics of this option correspond exactly to those of
2642 the constructors of class @samp{java.util.Locale}.
2644 This option currently only determines which Collator is being used for
2645 sorting output elements.  This means that the locale will only have an
2646 effect when you are using non-ASCII characters in identifiers.
2648 @item -charset @var{charset}
2650 @emph{Deprecated.} Override the specified encoding in output XHTML
2651 files with the one given by @samp{charset}.
2653 If this option is not given, the encoding specification in output
2654 XHTML is chosen to match the encoding used when writing the file (the
2655 encoding given with @option{-docencoding}, or your platform's default
2656 encoding).
2658 The semantics for @var{charset} are specified here:
2659 @w{@uref{http://www.w3.org/TR/2000/REC-xml-20001006#NT-EncName}}.  For
2660 all practical purposes, they are identical to those of the other
2661 options accepting charset parameters.
2663 This option is here for compatibility with @command{javadoc} and
2664 should be avoided.
2666 @item -docencoding @var{charset}
2668 Use the given charset encoding when writing output files instead of
2669 your platform's default encoding.
2671 Examples for @var{charset} are @samp{US-ASCII}, @samp{ISO-8859-1} or
2672 @samp{UTF-8}.
2674 The semantics of this option correspond exactly to those of the
2675 constructors of class @samp{java.util.Locale}.
2677 @item -validhtml
2679 Force generation of valid XHTML code.  This breaks compatibility to
2680 the traditional Javadoc tool to some extent.
2682 If this option is specified, anchor names will be mangled so that they
2683 are valid according to the XHTML 1.1 specification.  However, a
2684 documentation set generated with this option cannot be linked to
2685 properly using the traditional Javadoc tool.  It can be linked to just
2686 fine using Gjdoc, though.
2688 Without this option, anchor names for executable class members use the
2689 traditional format, for example: ``foo(String,int[])''.  This is
2690 compatible to the traditional Javadoc tool, but according to both the
2691 HTML 4.0 and XHTML 1.0 and 1.1 specifications, this format includes
2692 illegal characters.  Parentheses, square brackets, and the comma are
2693 not allowed in anchor names.
2695 @item -baseurl @var{url}
2697 Hardwire a page URL relative to @var{url} into each generated page.
2699 If you are generating documentation which will exclusively be
2700 available at a certain URL, you should use this option to specify this
2701 URL.
2703 This can help avoid certain redirect attacks used by spammers, and it
2704 can be helpful for certain web clients.
2706 @end table
2708 @node Verbosity Options, Doclet Options, Virtual Machine Options, gjdoc Tool
2709 @section Verbosity Options
2711 @table @gcctabopt
2712 @item -quiet
2713 Suppress all output except for warnings and error messages.
2715 @item -verbose
2716 Be very verbose about what @command{gjdoc} is doing.
2718 This option is currently ignored.
2720 @end table
2722 @node Virtual Machine Options, Verbosity Options, Taglet Options, gjdoc Tool
2723 @section Virtual Machine Options
2725 Sun's @command{javadoc} tool seems to be based on @command{javac} and
2726 as such it seems to operate on the VM level.  @command{gjdoc}, in
2727 contrast, is a pure Java application.
2729 Therefore, @command{gjdoc} can only fake, or simulate, the following
2730 VM-level options.
2732 @table @gcctabopt
2734 @item -classpath @var{pathlist}
2735 Set the Virtual Machine @samp{classpath} to @var{pathlist}.
2737 In most cases you should use @option{-docletpath} or
2738 @option{-tagletpath} instead of this option.
2740 @var{pathlist} should be one or more paths to a directory or jar file,
2741 separated by your platform's path separator (usually @samp{:} or
2742 @samp{;}).
2744 If this option is not intercepted at the wrapper level,
2745 @command{gjdoc} currently fakes it by calling
2746 @samp{System.setProperty("java.class.path", @var{pathlist});} and
2747 outputs a warning.
2749 @item -bootclasspath @var{pathlist}
2750 Set the Virtual Machine @samp{bootclasspath} to @var{pathlist}.
2752 If this option is not intercepted at the wrapper level,
2753 @command{gjdoc} outputs a warning.
2755 @item -J@var{vmopt}
2757 Pass an arbitrary parameter to the Virtual Machine @command{gjdoc}
2758 runs on.
2760 If this option is not intercepted at the wrapper level,
2761 @command{gjdoc} tries to emulate the option and outputs a warning.
2763 Currently, only the VM option @option{-D} for setting system
2764 properties is emulated.
2766 @end table
2768 @c man end
2770 @comment ----------------------------------------------------------------------
2772 @node Invoking a Custom Doclet, Option Summary by Type, Invoking the Standard Doclet, gjdoc Tool
2773 @section Invoking a Custom Doclet
2775 For invoking one of the other doclets shipping with @command{gjdoc} or
2776 a third-party doclet, the canonical usage is:
2778 @smallexample
2779 gjdoc -s src/java/ -all \
2780   -docletpath /path/to/doclet.jar -doclet foo.BarDoclet \
2781   (more Gjdoc core options and Doclet-specific options here)
2782 @end smallexample
2784 @samp{/path/to/doclet.jar} is a placeholder for a class path
2785 specifying where the Doclet classes and dependencies can be found and
2786 @samp{foo.BarDoclet} is the fully-qualified name of the Doclet's main
2787 class.
2789 @comment ----------------------------------------------------------------------
2791 @node Gjdoc Option Summary, Source Set Options, Option Summary by Type, gjdoc Tool
2792 @section Gjdoc Option Summary
2793 @cindex Gjdoc Options
2795 @comment ----------------------------------------------------------------------
2797 @node Other Doclets, Gjdoc Concepts, Doclet Options, gjdoc Tool
2798 @chapter Generating Other Output Types
2800 @menu
2801 * Built-in Doclets::
2802 * Third-party Doclets::
2803 @end menu
2805 @comment ----------------------------------------------------------------------
2807 @node Built-in Doclets, Third-party Doclets, , Other Doclets
2808 @section Using the Built-in Doclets
2809 @cindex Built-in Doclets
2811 @menu
2812 * Using XmlDoclet::
2813 * Using TexiDoclet::
2814 * Using IspellDoclet::
2815 * Using DebugDoclet::
2816 @end menu
2818 @comment ----------------------------------------------------------------------
2820 @node Using TexiDoclet, Using XmlDoclet, , Built-in Doclets
2821 @subsection TexiDoclet: Generating Info, PDF, and other formats
2822 @cindex TexiDoclet
2824 Missing.
2826 @comment ----------------------------------------------------------------------
2828 @node Using XmlDoclet, Using IspellDoclet, Using TexiDoclet, Built-in Doclets
2829 @subsection XmlDoclet: Generating XML Documentation
2830 @cindex HtmlDoclet
2832 Missing.
2834 @comment ----------------------------------------------------------------------
2836 @node Using IspellDoclet, Using DebugDoclet, Using XmlDoclet, Built-in Doclets
2837 @subsection IspellDoclet: Spell-checking Source Code
2838 @cindex IspellDoclet
2840 Missing.
2842 @comment ----------------------------------------------------------------------
2844 @node Using DebugDoclet, , Using IspellDoclet, Built-in Doclets
2845 @subsection DebugDoclet: Inspecting the Doclet API
2846 @cindex HtmlDoclet
2848 Missing.
2850 @comment ----------------------------------------------------------------------
2852 @node Third-party Doclets, , Built-in Doclets, Other Doclets
2853 @section Using Third-Party Doclets
2854 @cindex Third-party Doclets
2856 @menu
2857 * DocBook Doclet::
2858 * PDFDoclet::
2859 * JUnitDoclet::
2860 @end menu
2862 @comment ----------------------------------------------------------------------
2864 @node DocBook Doclet,PDFDoclet, ,Third-party Doclets
2865 @subsection DocBook Doclet
2866 @cindex DocBook Doclet
2868 Missing.
2870 @comment ----------------------------------------------------------------------
2872 @node PDFDoclet, JUnitDoclet, DocBook Doclet, Third-party Doclets
2873 @subsection PDFDoclet
2874 @cindex PDFDoclet
2876 Missing.
2878 @comment ----------------------------------------------------------------------
2880 @node JUnitDoclet, , PDFDoclet, Third-party Doclets
2881 @subsection JUnitDoclet
2882 @cindex JUnitDoclet
2884 Missing.
2886 @comment ----------------------------------------------------------------------
2888 @node Gjdoc Concepts, , Other Doclets, gjdoc Tool
2889 @chapter Advanced Concepts
2891 @menu
2892 * Writing Doclets::
2893 * Taglets::
2894 * XHTML Fragments::
2895 * First Sentence Detector::
2896 * Adding Custom Resources::
2897 @end menu
2899 @comment ----------------------------------------------------------------------
2901 @node Taglets, Writing Doclets, , Gjdoc Concepts
2902 @section Adding Custom Tags to the Documentation
2903 @cindex Taglet
2905 Missing.
2907 @comment ----------------------------------------------------------------------
2909 @node Writing Doclets, XHTML Fragments, Taglets, Gjdoc Concepts
2910 @section Writing Doclets
2911 @cindex Taglet
2913 If the various Doclets already available don't suit your needs, you
2914 can write a custom Doclet yourself.  
2916 @menu
2917 * Doclet Invocation Interface::
2918 * Using AbstractDoclet::
2919 * GNU Doclet SPI::
2920 @end menu
2922 @comment ----------------------------------------------------------------------
2924 @node Doclet Invocation Interface, Using AbstractDoclet, , Writing Doclets
2925 @subsection Implementing the Doclet Invocation Interface
2927 A Doclet is a class that contains a method with the following
2928 signature:
2930 @smallexample
2931 public static boolean start(RootDoc rootDoc);
2932 @end smallexample
2934 @var{rootDoc} is the root of an object hierarchy containing the
2935 information @command{gjdoc} extracted from the source files.  See the
2936 Doclet API for more details.
2938 @samp{start} should process all the information and return
2939 @samp{true} on success, @samp{false} on failure.
2941 For printing status information, the Doclet should use methods
2942 @samp{printNotice}, @samp{printWarning} and @samp{printError} instead
2943 of @samp{System.err}.  The Doclet can opt to use @samp{System.out} for
2944 redirectable output.
2946 @comment ----------------------------------------------------------------------
2948 @node Using AbstractDoclet, GNU Doclet SPI, Doclet Invocation Interface, Writing Doclets
2949 @subsection Deriving Your Doclet from AbstractDoclet
2950 @cindex AbstractDoclet
2952 You may want your Doclet to provide functionality similar to
2953 HtmlDoclet.  For example, you may want it to support Taglets, generate
2954 Index, Tree, and Uses pages, or show other cross-reference information
2955 like @samp{Overrides} and @samp{All Implementing Classes}.
2957 This information is not directly provided by the Doclet API, so your
2958 Doclet would normally have to assemble it itself.  For example, it
2959 would have to add the names of all program elements to a list and sort
2960 this list in order to create the Index page.
2962 If you want to provide this information or part of it, you should
2963 consider deriving your class from
2964 @samp{gnu.classpath.tools.doclets.AbstractDoclet}.  This class
2965 provides the following benefits:
2967 @itemize @bullet
2969 @item 
2970 Handles options @option{-tag}, @option{-taglet}, @option{-tagletpath}
2971 (Taglets)
2973 @item 
2974 Provides standard taglets for @@version, @@author, @@since, @@serial,
2975 @@deprecated, @@see, @@param, @@return and handles all related options
2976 (@option{-version}, @option{-author}, @option{-nosince},
2977 @option{-nodeprecated})
2979 @item 
2980 Handles option @option{-d} (destination directory)
2982 @item 
2983 Handles option @option{-noqualifier} (classes to omit qualifier for)
2985 @item 
2986 Handles options @option{-docfilessubdirs} and
2987 @option{-excludedocfilessubdir} (resource copying)
2989 @item 
2990 Can generate a full index or an index split by first letter
2992 @item 
2993 Can generate a full tree and package trees
2995 @item 
2996 Can generate cross-reference information
2998 @item 
2999 Can aggregate interface information (all superinterfaces, all
3000 subinterfaces, all implementing classes)
3002 @item 
3003 Provides convenient access to constructors, fields, methods, and inner
3004 classes sorted by name/signature instead of the default sort order.
3006 @item 
3007 Provides various other convenience methods
3009 @end itemize
3011 If you derive from @samp{AbstractDoclet}, there are a number of things
3012 you need to take care of:
3014 @itemize @bullet
3016 @item 
3018 @end itemize
3020 you should not implement the
3021 @samp{start(RootDoc)} method as it is already defined by
3022 @samp{AbstractDoclet} so that it can care about parsing the options.
3024 Instead, you implement method @samp{run()}, @samp{getOptions()} and
3025 the other abstract methods to define your Doclet's behavior.
3027 Note that all information provided by @samp{AbstractDoclet} is
3028 evaluated lazily.  That is, if your Doclet doesn't need to create an
3029 Index page, then @samp{AbstractDoclet} will not spend resources on
3030 creating the corresponding information.
3032 See the API documentation for
3033 @samp{gnu.classpath.tools.doclets.AbstractDoclet} for more details.
3035 You should be aware that if you base your Doclet on
3036 @samp{AbstractDoclet} then you have to bundle this and all related
3037 classes with your Doclet, with all implications such as possible
3038 licensing issues.  Otherwise, your Doclet will only be runnable on
3039 @samp{gjdoc} and not on other documentation systems.  Also note that
3040 @samp{AbstractDoclet} has not been extensively tested in environments
3041 other than @samp{gjdoc}.
3043 @comment ----------------------------------------------------------------------
3045 @node GNU Doclet SPI, , Using AbstractDoclet, Writing Doclets
3046 @subsection Preparing for the GNU Doclet Service Provider Interface
3047 @cindex GNU Doclet SPI, Service Provider, SPI
3049 In addition to the standard Doclet invocation interface described
3050 above, @command{gjdoc} also offers a Service Provider Interface
3051 conforming to the Java standard.  Adding support for this interface to
3052 your Doclet simplifies usage for @command{gjdoc} users because it
3053 makes your Doclet ``discoverable''.
3055 In order to provide the alternate interface, you have to add a class
3056 implementing @samp{gnu.classpath.tools.gjdoc.spi.DocletSpi} to your
3057 Doclet classes, and bundle all Doclet classes in a Jar file along with
3058 a file named
3059 @samp{META_INF/services/gnu.classpath.tools.gjdoc.spi.DocletSpi} which
3060 contains the name of your class implementing DocletSpi on a single
3061 line.
3063 Note that if your Doclet depends on third-party classes bundled in
3064 separate Jar files, you can link in these classes using the
3065 @samp{Class-path:} Manifest attribute of your Doclet Jar.
3067 Your Doclet can then be invoked in one of the following ways:
3068 @smallexample
3069 gjdoc -docletjar /path/to/doclet.jar
3070 gjdoc -docletpath /path/to/doclet.jar -docletname @var{docletname}
3071 gjdoc -docletname @var{docletname}
3072 @end smallexample
3074 Here, @var{docletname} is the name of your doclet as returned by
3075 @samp{DocletSpi.getDocletName()}.
3077 The last example will only work if your Doclet Jar is in
3078 @command{gjdoc}'s @file{doclets} directory or if it is on the
3079 classpath.
3081 @comment ----------------------------------------------------------------------
3083 @node XHTML Fragments, First Sentence Detector, Writing Doclets, Gjdoc Concepts
3084 @section Well-formed Documentation Fragments
3085 @cindex XHTML Fragments
3087 For many Doclets it is advantagous if the HTML code in the comments
3088 and HTML code passed via the command line is well-formed.  For
3089 example, HtmlDoclet outputs XHTML code, and XmlDoclet XML code, both
3090 of which results in invalid files if the user-specified HTML isn't
3091 wellformed.
3093 Unfortunately, comments were never required to contain well-formed
3094 HTML code, which means that every Doclet must deal with non-wellformed
3095 code as well.
3097 The @command{gjdoc} built-in Doclets deal with this problem by
3098 ``fixing'' the HTML code - making sure that all tags are closed,
3099 attribute values are provided and quoted, tags are properly nested,
3100 etc.
3102 This approach works OK in most instances, but since it uses some crude
3103 heuristics it can sometimes produce undesirable result.
3105 Therefore, in order to make sure that your comments are always
3106 properly formatted, make sure they are well-formed as described in
3107 @w{@uref{http://www.w3.org/TR/xhtml1/#h-4.1, XHTML 1.0: Documents must
3108 be well-formed}}.
3110 In addition, you should use meaningful tags instead of text formatting
3111 tags to make your output look better in other output formats derived
3112 from your HTML code.  For example, you should use the <em> tag instead
3113 of <b> if you want to emphasize text.
3115 @comment ----------------------------------------------------------------------
3117 @node First Sentence Detector, Adding Custom Resources, XHTML Fragments, Gjdoc Concepts
3118 @section How Gjdoc Determines where the First Sentence Ends
3119 @cindex First Sentence Detector
3121 For a package, class or member summary, @command{gjdoc} only shows the
3122 first sentence of the documentation comment in question.  Because
3123 @command{gjdoc} is not human, it is not always obvious to
3124 @command{gjdoc} where the first sentence ends.
3126 You might be tempted to say that the first sentence ends at the first
3127 occurrence of a punctuation character like @samp{.} or
3128 @samp{!}. However, consider examples like this:
3129 @smallexample
3130 This work, by Thomas J. Shahan et al., is about the middle ages.
3131 @end smallexample
3133 As you can see, it is not trivial to determine the end of the
3134 sentence.
3136 @command{gjdoc} gives you the choice between two approaches.  By
3137 default it uses built-in heuristics which should be compatible to
3138 Sun's @command{javadoc} tool.  This approach works quiet well in most
3139 cases, at least for english comments.
3141 Alternatively, you can specify option @option{-breakiterator} in which
3142 case @command{gjdoc} will use
3143 @samp{java.text.BreakIterator.getSentenceInstance(@var{locale}).next()}
3144 to find the end of sentence, where @var{locale} is the locale
3145 specified by option @samp{-locale} or the default locale if none
3146 specified.
3148 @emph{NOT YET IMPLEMENTED:}
3150 @command{gjdoc} also allows you to explicitly delineate the first
3151 sentence by putting it in a @samp{<span>} tag with the CSS class
3152 @samp{first-sentence}.  For example:
3153 @smallexample
3155  *  <span class="first-sentence">This. is. the. first. 
3156  *  sentence.</span> This is the second sentence.
3157  */
3158 @end smallexample
3160 Note that this will only work with @command{gjdoc}, but shouldn't hurt
3161 when using another documentation system since the @samp{<span>} tag
3162 usually doesn't show up in the output.
3164 @comment ----------------------------------------------------------------------
3166 @node Adding Custom Resources, , First Sentence Detector, Gjdoc Concepts
3167 @section Adding Images and Other Resources
3168 @cindex First Sentence Detector
3170 Sometimes you want to decorate your documentation with secondary
3171 resources such as images, SVG graphics, applets, and so on.  To do so,
3172 simply put the required files in a subdirectory 'doc-files' in the
3173 package directory corresponding to the documentation entry you want to
3174 decorate, and refer to it with the URL
3175 @samp{doc-files/@var{filename}}.
3177 For example, if you want to add an image to the description of class
3178 @samp{baz.FooBar}, create a directory @file{doc-files} in the
3179 directory @file{baz} containing @file{FooBar.java} and put your file,
3180 say @file{diagram.png}, into that directory.  Then, add the HTML code
3181 like this to a comment in @file{FooBar.java}:
3182 @smallexample
3183 <img src="doc-files/diagram.png" width="200" height="150"
3184   alt="Foo Diagram"/>
3185 @end smallexample
3187 This works because the @file{doc-files} subdirectories will be copied
3188 to the target documentation directory every time you generate the
3189 documentation.  
3191 Note however that by default, the @file{doc-files} directory will not
3192 be copied deeply.  In other words, if you create subdirectories under
3193 @file{doc-files} they will not be copied and any resources located in
3194 these subdirectories will not be accessible in your generated
3195 documentation.  You can specify option @option{-docfilessubdirs} to
3196 remove this limitation.
3198 Sometimes you want to use option @option{-docfilessubdirs}, but there
3199 are certain directories which you don't want to be copied, for example
3200 because they contain source files for the resources in
3201 @file{doc-files}.  For cases like this, use
3202 @option{-excludedocfilessubdir} to specify directories to be omitted.
3204 @comment ----------------------------------------------------------------------
3206 @node I18N Issues, , Other Tools, Top
3207 @comment node-name, next, previous, up
3208 @chapter I18N Issues
3210 Some tools --@pxref{Security Tools}-- allow using other than the English language when prompting the User for input, and outputting messages. This chapter describes the elements used to offer this support and how they can be adapted for use with specific languages.
3212 @menu
3213 * Language Resources::         Where resources are located
3214 * Message Formats::            How messages are internationalized
3215 @end menu
3217 @comment ----------------------------------------------------------------------
3219 @node Language Resources, Message Formats, I18N Issues, I18N Issues
3220 @comment node-name, next, previous, up
3221 @section Language-specific resources
3223 The Tools use Java @code{ResourceBundle}s to store messages, and message templates they use at runtime to generate the message text itself, depending on the locale in use at the time.
3225 The @i{Resource Bundles} these tools use are essentially Java @i{Properties} files consisting of a set of @i{Name/Value} pairs. The @i{Name} is the @i{Property Name} and the @i{Value} is a substitution string that is used when the code references the associated @i{Name}. For example the following is a line in a @i{Resource Bundle} used by the @code{keytool} Tool:
3227 @example
3228 Command.23=A correct key password MUST be provided
3229 @end example
3231 When the tool needs to signal a mandatory but missing key password, it would reference the property named @code{Command.23} and the message "@kbd{A correct key password MUST be provided}" will be used instead. This indirect referencing of "resources" permits replacing, as late as possible, the English strings with strings in other languages, provided of course @i{Resource Bundles} in those languages are provided.
3233 For the GNU Classpath Tools described in this Guide, the @i{Resource Bundles} are files named @file{messages[_ll[_CC[_VV]]].properties} where:
3235 @ftable @var
3236 @item ll
3237 Is the 2-letter code for the Language,
3238 @item CC
3239 Is the 2-letter code for the Region, and
3240 @item VV
3241 Is the 2-letter code for the Variant of the language.
3242 @end ftable
3244 The complete list of language codes can be found at @uref{http://ftp.ics.uci.edu/pub/ietf/http/related/iso639.txt, Code for the representation of names of languages}. A similar list for the region codes can be found at @uref{http://userpage.chemie.fu-berlin.de/diverse/doc/ISO_3166.html, ISO 3166 Codes (Countries)}.
3246 The location of the @i{Resource Bundles} for the GNU Classpath Tools is specific to each tool. The next table shows where these files are found in a standard GNU Classpath distribution:
3248 @ftable @code
3249 @item jarsigner
3250 @file{gnu/classpath/tools/jarsigner}
3251 @item keytool
3252 @file{gnu/classpath/tools/keytool}
3253 @end ftable
3255 The collection of @i{Resource Bundles} in a location act as an inverted tree with a parent-child relationship. For example suppose in the @file{gnu/classpath/tools/keytool} there are 3 message bundles named:
3257 @enumerate
3258 @item @code{messages.properties}
3259 @item @code{messages_fr.properties}
3260 @item @code{messages_fr_FR.properties}
3261 @end enumerate
3263 In the above example, bundle #1 will act as the parent of bundle #2, which in turn will act as the parent for bundle #3. This ordering is used by the Java runtime to choose which file to load based on the set Locale. For example if the Locale is @code{fr_CH}, @code{messages_fr.properties} will be used because (a) @code{messages_fr_CH.properties} does not exist, but (b) @code{messages_fr.properties} is the parent for the required bundle, and it exists. As another example, suppose the Locale was set to @code{en_AU}; then the tool will end up using @code{messages.properties} because (a) @code{messages_en_AU.properties} does not exist, (b) @code{messages_en.properties} which is the parent for the required bundle does not exist, but (c) @code{messages.properties} exists and is the root of the hierarchy.
3265 You can see from the examples above that @file{messages.properties} is the safety net that the Java runtime falls back to when failing to find a specific bundle and its parent(s). This file is always provided with the Tool. In time, more localized versions will be included to cater for other languages.
3267 In the meantime, if you are willing to contribute localized versions of these resources, grab the @file{messages.properties} for a specific tool; translate it; save it with the appropriate language and region suffix and mail it to @code{classpath@@gnu.org}.
3269 @comment ----------------------------------------------------------------------
3271 @node Message Formats, , Language Resources, I18N Issues
3272 @comment node-name, next, previous, up
3273 @section Message formats
3275 If you open any of the @file{messages.properties} described in the previous section, you may see properties that look like so:
3277 @example
3278 Command.67=Issuer: @{0@}
3279 Command.68=Serial number: @{0,number@}
3280 Command.69=Valid from: @{0,date,full@} - @{0,time,full@}
3281 Command.70=\ \ \ \ \ until: @{0,date,full@} - @{0,time,full@}
3282 @end example
3284 These are @i{Message Formats} used by the tools to customize a text string that will then be used either as a prompt for User input or as output.
3286 If you are translating a @file{messages.properties} be careful not to alter text between curly braces.
3288 @comment ----------------------------------------------------------------------
3290 @bye