cp-tools.texinfo 116 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291
  1. \input texinfo @c -*-texinfo-*-
  2. @c %**start of header
  3. @setfilename cp-tools.info
  4. @settitle GNU Classpath Tools Guide
  5. @c %**end of header
  6. @copying
  7. This file documents the Tools included in a standard distribution of the GNU
  8. Classpath project deliverables.
  9. Copyright @copyright{} 2006, 2007 Free Software Foundation, Inc.
  10. @quotation
  11. 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.
  12. 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.
  13. 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.
  14. @end quotation
  15. @end copying
  16. @c Common macros to support generating man pages:
  17. @macro gcctabopt{body}
  18. @code{\body\}
  19. @end macro
  20. @macro gccoptlist{body}
  21. @smallexample
  22. \body\
  23. @end smallexample
  24. @end macro
  25. @ifinfo
  26. @ifnotplaintext
  27. @setchapternewpage on
  28. @dircategory GNU Libraries
  29. @direntry
  30. * Classpath Tools: (cp-tools). GNU Classpath Tools Guide
  31. @end direntry
  32. @end ifnotplaintext
  33. @end ifinfo
  34. @titlepage
  35. @title GNU Classpath Tools Guide
  36. @author The GNU Classpath Team
  37. @page
  38. @vskip 0pt plus 1filll
  39. @insertcopying
  40. @end titlepage
  41. @contents
  42. @ifinfo
  43. @node Top, Applet Tools, (dir), (dir)
  44. @top GNU Classpath Tools Guide
  45. This document contains important information you need to know in order to use
  46. the tools included in the GNU Classpath project deliverables.
  47. The Tools aim at providing a free replacement, similar in their behavior, to
  48. their counter-parts found in the Reference Implementation (RI) of the Java
  49. Software Development Kit (SDK).
  50. @end ifinfo
  51. @menu
  52. * Applet Tools:: Work with applets
  53. * Security Tools:: Work securely with Java applications
  54. * Other Tools:: Other tools in classpath
  55. * I18N Issues:: How to add support for non-English languages
  56. @detailmenu
  57. --- The Detailed Node Listing ---
  58. Applet Tools
  59. * appletviewer Tool:: Load applets
  60. * gcjwebplugin:: Load applets in a web browser
  61. Security Tools
  62. * jarsigner Tool:: Sign and verify .JAR files
  63. * keytool Tool:: Manage private keys and public certificates
  64. jarsigner Tool
  65. * Common jarsigner Options:: Options used when signing or verifying a file
  66. * Signing Options:: Options only used when signing a .JAR file
  67. * Verification Options:: Options only used when verifying a .JAR file
  68. keytool Tool
  69. * Getting Help:: How to get help with keytool commands
  70. * Common keytool Options:: Options used in more than one command
  71. * Distinguished Names:: X.500 Distinguished Names used in certificates
  72. * Add/Update Commands:: Commands for adding data to a Key Store
  73. * Export Commands:: Commands for exporting data from a Key Store
  74. * Display Commands:: Commands for displaying data in a Key Store
  75. * Management Commands:: Commands for managing a Key Store
  76. Add/Update Commands
  77. * Command -genkey:: Generate private key and self-signed certificate
  78. * Command -import:: Import certificates and certificate replies
  79. * Command -selfcert:: Generate self-signed certificate
  80. * Command -cacert:: Import a CA Trusted Certificate
  81. * Command -identitydb:: Import JDK-1 style identities
  82. Export Commands
  83. * Command -certreq:: Generate Certificate Signing Requests (CSR)
  84. * Command -export:: Export a certificate in a Key Store
  85. Display Commands
  86. * Command -list:: Display information about one or all Aliases
  87. * Command -printcert:: Print a certificate or a certificate fingerprint
  88. Management Commands
  89. * Command -keyclone:: Clone a Key Entry in a Key Store
  90. * Command -storepasswd:: Change the password protecting a Key Store
  91. * Command -keypasswd:: Change the password protecting a Key Entry
  92. * Command -delete:: Remove an entry in a Key Store
  93. Other Tools
  94. * jar Tool:: Archive tool for Java archives
  95. * javah Tool:: A java header compiler
  96. * gcjh Tool:: A java header compiler (old version)
  97. * native2ascii Tool:: An encoding converter
  98. * orbd Tool:: An object request broker daemon
  99. * serialver Tool:: A serial version command
  100. * rmid Tool:: RMI activation daemon
  101. * rmiregistry Tool:: Remote object registry
  102. * tnameserv Tool:: Naming service
  103. * gjdoc Tool:: Documenation generator tool.
  104. Generating HTML Documentation
  105. * Invoking the Standard Doclet:: How to generate HTML documentation.
  106. * Invoking a Custom Doclet:: How to run third-party and other
  107. built-in Doclets.
  108. * Option Summary by Type:: Brief list of all options, grouped by type.
  109. * Gjdoc Option Summary:: List of all options accepted by Gjdoc.
  110. * Source Set Options:: Select the set of source codes to run Gjdoc on.
  111. * Source Format Options:: Specify the format of the source codes to document.
  112. * Interlinking Options:: Connection your documentation with other projects.
  113. * Output Control Options:: Specify the target directory and locale, and more.
  114. * Generation Options:: Select which pieces of information to generate.
  115. * Decoration Options:: Add or modify some titles, headers and footers or
  116. override/amend static resources like stylesheets.
  117. * Taglet Options:: Define your own javadoc @@tags.
  118. * Virtual Machine Options:: Controlling the kind of output:
  119. an executable, object files, assembler files,
  120. or preprocessed source.
  121. * Verbosity Options::
  122. * Doclet Options::
  123. * Other Doclets:: Generating Other Output Types.
  124. * Built-in Doclets:: Using the Built-in Doclets.
  125. * Using XmlDoclet::
  126. * Using TexiDoclet::
  127. * Using IspellDoclet::
  128. * Using DebugDoclet::
  129. * Third-party Doclets:: Using Third-Party Doclets.
  130. * DocBook Doclet::
  131. * PDFDoclet::
  132. * JUnitDoclet::
  133. * Gjdoc Concepts:: Advanced Concepts.
  134. * Writing Doclets::
  135. * Doclet Invocation Interface:: Implementing the Doclet Invocation Interface
  136. * Using AbstractDoclet:: Deriving Your Doclet from AbstractDoclet.
  137. * GNU Doclet SPI:: Preparing the GNU Doclet Service Provider
  138. Interface.
  139. * Taglets:: Adding Custom Tags to the Documentation.
  140. * XHTML Fragments:: Well-Formed Documentation Fragments.
  141. * First Sentence Detector:: How Gjdoc Determines where the First
  142. Sentence Ends.
  143. * Adding Custom Resources:: Adding Images and Other Resources.
  144. I18N Issues
  145. * Language Resources:: Where resources are located
  146. * Message Formats:: How messages are internationalized
  147. @end detailmenu
  148. @end menu
  149. @comment ----------------------------------------------------------------------
  150. @node Applet Tools, Security Tools, Top, Top
  151. @comment node-name, next, previous, up
  152. @chapter Applet Tools
  153. Two Applet Tools are available with GNU Classpath: @b{appletviewer}
  154. and @b{gcjwebplugin}.
  155. To avoid conflicts with other implementations, the appletviewer
  156. executable is called ``gappletviewer''.
  157. @menu
  158. * appletviewer Tool:: Load applets
  159. * gcjwebplugin:: Load applets in a web browser
  160. @end menu
  161. 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}.
  162. @comment ----------------------------------------------------------------------
  163. @node appletviewer Tool, gcjwebplugin, Applet Tools, Applet Tools
  164. @comment node-name, next, previous, up
  165. @section The @code{appletviewer} Tool
  166. @c man title gappletviewer Load and runs an applet
  167. SYNOPSIS
  168. @c man begin SYNOPSIS gappletviewer
  169. appletviewer [@var{OPTION}]@dots{} @var{URL}@dots{} @var{@*}
  170. appletviewer [@var{OPTION}]@dots{} @option{-code} @var{CODE} @var{@*}
  171. appletviewer [@var{OPTION}]@dots{} @option{-plugin} @var{INPUT},@var{OUTPUT}
  172. @c man end
  173. DESCRIPTION
  174. @c man begin DESCRIPTION gappletviewer
  175. The @command{appletviewer} tool loads and runs an applet.
  176. Use the first form to test applets specified by tag. The URL should
  177. resolve to an HTML document from which the @command{appletviewer} will
  178. extract applet tags. The APPLET, EMBED and OBJECT tags are supported.
  179. If a given document contains multiple applet tags, all the applets
  180. will be loaded, with each applet appearing in its own window.
  181. Likewise, when multiple URLs are specified, each applet tag instance
  182. is given its own window. If a given document contains no recognized
  183. tags the @command{appletviewer} does nothing.
  184. @smallexample
  185. appletviewer http://www.gnu.org/software/classpath/
  186. @end smallexample
  187. Use the second form to test an applet in development. This form
  188. allows applet tag attributes to be supplied on the command line. Only
  189. one applet may be specified using the @option{-code} option. The
  190. @option{-code} option overrides the URL form -- any URLs specified will
  191. be ignored.
  192. @smallexample
  193. appletviewer -code Test.class -param datafile,data.txt
  194. @end smallexample
  195. @command{gcjwebplugin} uses the third form to communicate with the
  196. @command{appletviewer} through named pipes.
  197. @c man end
  198. @c man begin OPTIONS gappletviewer
  199. URL OPTIONS
  200. @table @gcctabopt
  201. @item -debug
  202. This option is not yet implemented but is provided for compatibility.
  203. @item -encoding @var{CHARSET}
  204. Use this option to specify an alternate character encoding for the
  205. specified HTML page.
  206. @end table
  207. APPLET TAG OPTIONS
  208. @table @gcctabopt
  209. @item -code @var{CODE}
  210. Use the @option{-code} option to specify the value of the applet tag
  211. @var{CODE} attribute.
  212. @item -codebase @var{CODEBASE}
  213. Use the @option{-codebase} option to specify the value of the applet tag
  214. @var{CODEBASE} attribute.
  215. @item -archive @var{ARCHIVE}
  216. Use the @option{-archive} option to specify the value of the applet tag
  217. @var{ARCHIVE} attribute.
  218. @item -width @var{WIDTH}
  219. Use the @option{-width} option to specify the value of the applet tag
  220. @var{WIDTH} attribute.
  221. @item -height @var{HEIGHT}
  222. Use the @option{-height} option to specify the value of the applet tag
  223. @var{HEIGHT} attribute.
  224. @item -param @var{NAME},@var{VALUE}
  225. Use the @option{-param} option to specify values for the @var{NAME}
  226. and @var{VALUE} attributes of an applet PARAM tag.
  227. @end table
  228. PLUGIN OPTION
  229. @table @gcctabopt
  230. @item -plugin @var{INPUT},@var{OUTPUT}
  231. @command{gcjwebplugin} uses the @option{-plugin} option to specify the
  232. named pipe the @command{appletviewer} should use for receiving commands
  233. (@var{INPUT}) and the one it should use for sending commands to
  234. @command{gcjwebplugin} (@var{OUTPUT}).
  235. @end table
  236. DEBUGGING OPTION
  237. @table @gcctabopt
  238. @item -verbose
  239. Use the @option{-verbose} option to have the @command{appletviewer} print
  240. debugging messages.
  241. @end table
  242. STANDARD OPTIONS
  243. @table @gcctabopt
  244. @item -help
  245. Use the @option{-help} option to have the @command{appletviewer} print a
  246. usage message, then exit.
  247. @item -version
  248. Use the @option{-version} option to have the @command{appletviewer} print
  249. its version, then exit.
  250. @item -J@var{OPTION}
  251. Use the @option{-J} option to pass @var{OPTION} to the virtual machine that
  252. will run the @command{appletviewer}. Unlike other options, there must
  253. not be a space between the @option{-J} and @var{OPTION}.
  254. @end table
  255. @c man end
  256. @comment ----------------------------------------------------------------------
  257. @node gcjwebplugin, , appletviewer Tool, Applet Tools
  258. @comment node-name, next, previous, up
  259. @section The @code{gcjwebplugin} Tool
  260. @code{gcjwebplugin} is a plugin that adds applet support to web
  261. browsers. Currently @code{gcjwebplugin} only supports Mozilla-based
  262. browsers (e.g., Firefox, Galeon, Mozilla).
  263. @comment ----------------------------------------------------------------------
  264. @node Security Tools, Other Tools, Applet Tools, Top
  265. @comment node-name, next, previous, up
  266. @chapter Security Tools
  267. Two Security Tools are available with GNU Classpath:
  268. @command{jarsigner} and @command{keytool}.
  269. To avoid conflicts with other implementations, the jarsigner
  270. executable is called @command{gjarsigner} and the keytool executable is
  271. called @command{gkeytool}.
  272. @menu
  273. * jarsigner Tool:: Sign and verify .JAR files
  274. * keytool Tool:: Manage private keys and public certificates
  275. @end menu
  276. 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}.
  277. @comment ----------------------------------------------------------------------
  278. @node jarsigner Tool, keytool Tool, Security Tools, Security Tools
  279. @comment node-name, next, previous, up
  280. @section The @code{jarsigner} Tool
  281. @c man title gjarsigner Java ARchive (JAR) file signing and verification tool
  282. The @command{jarsigner} tool is invoked from the command line, in one
  283. of two forms, as follows:
  284. @example
  285. @c man begin SYNOPSIS gjarsigner
  286. jarsigner [@var{OPTION}]@dots{} @var{FILE} @var{ALIAS}
  287. jarsigner @option{-verify} [@var{OPTION}]@dots{} @var{FILE}
  288. @c man end
  289. @end example
  290. @c man begin DESCRIPTION gjarsigner
  291. 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.
  292. @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.
  293. @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.
  294. @c man end
  295. @menu
  296. * Common jarsigner Options:: Options used when signing or verifying a file
  297. * Signing Options:: Options only used when signing a .JAR file
  298. * Verification Options:: Options only used when verifying a .JAR file
  299. @end menu
  300. @comment ----------------------------------------------------------------------
  301. @node Common jarsigner Options, Signing Options, jarsigner Tool, jarsigner Tool
  302. @comment node-name, next, previous, up
  303. @c man begin OPTIONS gjarsigner
  304. @subsection Common options
  305. The following options may be used when the tool is used for either signing, or verifying, a .JAR file.
  306. @table @gcctabopt
  307. @item -verbose
  308. Use this option to force the tool to generate more verbose messages, during its processing.
  309. @item -internalsf
  310. When present, the tool will include --which otherwise it does not-- the @code{.SF} file in the @code{.DSA} generated file.
  311. @item -sectionsonly
  312. 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.
  313. @item -provider PROVIDER_CLASS_NAME
  314. 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.
  315. @item -help
  316. Prints a help text similar to this one.
  317. @end table
  318. @c man end
  319. @comment ----------------------------------------------------------------------
  320. @node Signing Options, Verification Options, Common jarsigner Options, jarsigner Tool
  321. @comment node-name, next, previous, up
  322. @c man begin OPTIONS gjarsigner
  323. @subsection Signing options
  324. The following options may be specified when using the tool for signing purposes.
  325. @table @gcctabopt
  326. @item -keystore @var{URL}
  327. 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.
  328. 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:}.
  329. @item -storetype @var{STORE_TYPE}
  330. 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}.
  331. @item -storepass @var{PASSWORD}
  332. 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.
  333. @item -keypass @var{PASSWORD}
  334. Use this option to specify the password which the tool will use to unlock the @i{Key Entry} associated with the designated @i{Alias}.
  335. 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.
  336. @item -sigfile @var{NAME}
  337. 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.
  338. 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.
  339. @item -signedjar @var{FILE}
  340. 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.
  341. @end table
  342. @c man end
  343. @comment ----------------------------------------------------------------------
  344. @node Verification Options, , Signing Options, jarsigner Tool
  345. @comment node-name, next, previous, up
  346. @c man begin OPTIONS gjarsigner
  347. @subsection Verification options
  348. The following options may be specified when using the tool for verification purposes.
  349. @table @gcctabopt
  350. @item -verify
  351. Use this option to indicate that the tool is to be used for verification purposes.
  352. @item -certs
  353. 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.
  354. @end table
  355. @c man end
  356. @comment ----------------------------------------------------------------------
  357. @node keytool Tool, , jarsigner Tool, Security Tools
  358. @comment node-name, next, previous, up
  359. @section The @code{keytool} Tool
  360. @c man title gkeytool Manage private keys and public certificates
  361. @ignore
  362. @c man begin SYNOPSIS gkeytool
  363. keytool [@var{COMMAND}] @dots{}
  364. @c man end
  365. @end ignore
  366. @c man begin DESCRIPTION gkeytool
  367. 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.
  368. 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.
  369. 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.
  370. @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}.
  371. The @command{keytool} is invoked from the command line as follows:
  372. @smallexample
  373. keytool [COMMAND] ...
  374. @end smallexample
  375. 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
  376. @smallexample
  377. keytool -list -- -printcert -alias mykey
  378. @end smallexample
  379. @c man end
  380. Here is a summary of the commands supported by the tool:
  381. @c man begin OPTIONS gkeytool
  382. @enumerate
  383. @item Add/Update commands
  384. @table @gcctabopt
  385. @item -genkey [@var{OPTION}]@dots{}
  386. Generate a new @i{Key Entry}, eventually creating a new key store.
  387. @item -import [@var{OPTION}]@dots{}
  388. 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).
  389. @item -selfcert [@var{OPTION}]@dots{}
  390. Generate a new self-signed @i{Trusted Certificate}.
  391. @item -cacert [@var{OPTION}]@dots{}
  392. Import a CA @i{Trusted Certificate}.
  393. @item -identitydb [@var{OPTION}]@dots{}
  394. @b{NOT IMPLEMENTED YET}.@*
  395. Import a JDK 1.1 style Identity Database.
  396. @end table
  397. @item Export commands
  398. @table @gcctabopt
  399. @item -certreq [@var{OPTION}]@dots{}
  400. 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.
  401. @item -export [@var{OPTION}]@dots{}
  402. Export a certificate from a key store.
  403. @end table
  404. @item Display commands
  405. @table @gcctabopt
  406. @item -list [@var{OPTION}]@dots{}
  407. Print one or all certificates in a key store to @code{STDOUT}.
  408. @item -printcert [@var{OPTION}]@dots{}
  409. Print a human-readable form of a certificate, in a designated file, to @code{STDOUT}.
  410. @end table
  411. @item Management commands
  412. @table @gcctabopt
  413. @item -keyclone [@var{OPTION}]@dots{}
  414. Clone a @i{Key Entry} in a key store.
  415. @item -storepasswd [@var{OPTION}]@dots{}
  416. Change the password protecting a key store.
  417. @item -keypasswd [@var{OPTION}]@dots{}
  418. Change the password protecting a @i{Key Entry} in a key store.
  419. @item -delete [@var{OPTION}]@dots{}
  420. Delete a @i{Key Entry} or a @i{Trusted Certificate} from a key store.
  421. @end table
  422. @end enumerate
  423. @c man end
  424. @menu
  425. * Getting Help:: How to get help with keytool commands
  426. * Common keytool Options:: Options used in more than one command
  427. * Distinguished Names:: X.500 Distinguished Names used in certificates
  428. * Add/Update Commands:: Commands for adding data to a Key Store
  429. * Export Commands:: Commands for exporting data from a Key Store
  430. * Display Commands:: Commands for displaying data in a Key Store
  431. * Management Commands:: Commands for managing a Key Store
  432. @end menu
  433. @comment ----------------------------------------------------------------------
  434. @node Getting Help, Common keytool Options, keytool Tool, keytool Tool
  435. @comment node-name, next, previous, up
  436. @subsection Getting help
  437. To get a general help text about the tool, use the @code{-help} option; e.g.
  438. @example
  439. @code{keytool -help}
  440. @end example
  441. To get more specific help text about one of the tool's command use the @code{-help} option for that command; e.g.
  442. @example
  443. @code{keytool -genkey -help}
  444. @end example
  445. In both instances, the tool will print a help text and then will exit the running JVM.
  446. 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.
  447. @comment ----------------------------------------------------------------------
  448. @node Common keytool Options, Distinguished Names, Getting Help, keytool Tool
  449. @comment node-name, next, previous, up
  450. @c man begin OPTIONS gkeytool
  451. @subsection Common options
  452. The following @option{OPTION}s are used in more than one @command{COMMAND}. They are described here to reduce redundancy.
  453. @table @gcctabopt
  454. @anchor{alias}
  455. @item -alias @var{Alias}
  456. 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.
  457. @anchor{keyalg}
  458. @item -keyalg @var{ALGORITHM}
  459. 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).
  460. @anchor{keysize}
  461. @item -keysize @var{SIZE}
  462. 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.
  463. @anchor{validity}
  464. @item -validity @var{DAY_COUNT}
  465. 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.
  466. @anchor{storetype}
  467. @item -storetype @var{STORE_TYPE}
  468. 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}.
  469. @anchor{storepass}
  470. @item -storepass @var{PASSWORD}
  471. 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.
  472. @anchor{keystore}
  473. @item -keystore @var{URL}
  474. 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.
  475. 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:}.
  476. @anchor{provider}
  477. @item -provider @var{PROVIDER_CLASS_NAME}
  478. 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.
  479. @anchor{file}
  480. @item -file @var{FILE}
  481. 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.
  482. @anchor{verbose}
  483. @item -v
  484. Unless specified otherwise, use this option to enable more verbose output.
  485. @end table
  486. @c man end
  487. @comment ----------------------------------------------------------------------
  488. @node Distinguished Names, Add/Update Commands, Common keytool Options, keytool Tool
  489. @comment node-name, next, previous, up
  490. @subsection X.500 Distinguished Names
  491. @anchor{dn}
  492. 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:
  493. @ftable @var
  494. @item CN
  495. The Common Name; e.g.@: @kbd{host.domain.com}
  496. @item OU
  497. The Organizational Unit; e.g.@: @kbd{IT Department}
  498. @item O
  499. The Organization Name; e.g.@: @kbd{The Sample Company}
  500. @item L
  501. The Locality Name; e.g.@: @kbd{Sydney}
  502. @item ST
  503. The State Name; e.g.@: @kbd{New South Wales}
  504. @item C
  505. The 2-letter Country identifier; e.g.@: @kbd{AU}
  506. @end ftable
  507. 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:@*
  508. @format
  509. CN=host.domain.com, O=The Sample Company, L=Sydney, ST=NSW, C=AU
  510. @end format
  511. @*
  512. 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.
  513. @comment ----------------------------------------------------------------------
  514. @node Add/Update Commands, Export Commands, Distinguished Names, keytool Tool
  515. @comment node-name, next, previous, up
  516. @c man begin OPTIONS gkeytool
  517. @subsection Add/Update commands
  518. @c man end
  519. @menu
  520. * Command -genkey:: Generate private key and self-signed certificate
  521. * Command -import:: Import certificates and certificate replies
  522. * Command -selfcert:: Generate self-signed certificate
  523. * Command -cacert:: Import a CA Trusted Certificate
  524. * Command -identitydb:: Import JDK-1 style identities
  525. @end menu
  526. @comment ----------------------------------------------------------------------
  527. @node Command -genkey, Command -import, Add/Update Commands, Add/Update Commands
  528. @comment node-name, next, previous, up
  529. @c man begin OPTIONS gkeytool
  530. @subsubsection The @option{-genkey} command
  531. 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}.
  532. 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.
  533. @table @gcctabopt
  534. @item -alias @var{ALIAS}
  535. For more details @pxref{alias,, ALIAS}.
  536. @item -keyalg @var{ALGORITHM}
  537. For more details @pxref{keyalg,, ALGORITHM}.
  538. @item -keysize @var{KEY_SIZE}
  539. For more details @pxref{keysize,, KEY_SIZE}.
  540. @item -sigalg @var{ALGORITHM}
  541. 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.
  542. @item -dname @var{NAME}
  543. 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.
  544. For more details @pxref{dn,, X.500 DISTINGUISHED NAME}.
  545. @item -keypass @var{PASSWORD}
  546. Use this option to specify the password which the tool will use to protect the newly created @i{Key Entry}.
  547. If this option is omitted, you will be prompted to provide a password.
  548. @item -validity @var{DAY_COUNT}
  549. For more details @pxref{validity,, DAY_COUNT}.
  550. @item -storetype @var{STORE_TYPE}
  551. For more details @pxref{storetype,, STORE_TYPE}.
  552. @item -keystore @var{URL}
  553. For more details @pxref{keystore,, URL}.
  554. @item -storepass @var{PASSWORD}
  555. For more details @pxref{storepass,, PASSWORD}.
  556. @item -provider @var{PROVIDER_CLASS_NAME}
  557. For more details @pxref{provider,, PROVIDER_CLASS_NAME}.
  558. @item -v
  559. For more details @pxref{verbose}.
  560. @end table
  561. @c man end
  562. @comment ----------------------------------------------------------------------
  563. @node Command -import, Command -selfcert, Command -genkey, Add/Update Commands
  564. @comment node-name, next, previous, up
  565. @c man begin OPTIONS gkeytool
  566. @subsubsection The @option{-import} command
  567. 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.
  568. 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.
  569. 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.
  570. @table @gcctabopt
  571. @item -alias @var{ALIAS}
  572. For more details @pxref{alias,, ALIAS}.
  573. @item -file @var{FILE}
  574. For more details @pxref{file,, FILE}.
  575. @item -keypass @var{PASSWORD}
  576. 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.
  577. 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.
  578. @item -noprompt
  579. Use this option to prevent the tool from prompting the user.
  580. @item -trustcacerts
  581. 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.
  582. @item -storetype @var{STORE_TYPE}
  583. For more details @pxref{storetype,, STORE_TYPE}.
  584. @item -keystore @var{URL}
  585. For more details @pxref{keystore,, URL}.
  586. @item -storepass @var{PASSWORD}
  587. For more details @pxref{storepass,, PASSWORD}.
  588. @item -provider @var{PROVIDER_CLASS_NAME}
  589. For more details @pxref{provider,, PROVIDER_CLASS_NAME}.
  590. @item -v
  591. For more details @pxref{verbose}.
  592. @end table
  593. @c man end
  594. @comment ----------------------------------------------------------------------
  595. @node Command -selfcert, Command -cacert, Command -import, Add/Update Commands
  596. @comment node-name, next, previous, up
  597. @c man begin OPTIONS gkeytool
  598. @subsubsection The @option{-selfcert} command
  599. 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).
  600. @table @gcctabopt
  601. @item -alias @var{ALIAS}
  602. For more details @pxref{alias,, ALIAS}.
  603. @item -sigalg @var{ALGORITHM}
  604. 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.
  605. @item -dname @var{NAME}
  606. 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.
  607. For more details @pxref{dn,, X.500 DISTINGUISHED NAME}.
  608. @item -validity @var{DAY_COUNT}
  609. For more details @pxref{validity,, DAY_COUNT}.
  610. @item -keypass @var{PASSWORD}
  611. Use this option to specify the password which the tool will use to unlock the @i{Key Entry} associated with the designated @i{Alias}.
  612. 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.
  613. @item -storetype @var{STORE_TYPE}
  614. For more details @pxref{storetype,, STORE_TYPE}.
  615. @item -keystore @var{URL}
  616. For more details @pxref{keystore,, URL}.
  617. @item -storepass @var{PASSWORD}
  618. For more details @pxref{storepass,, PASSWORD}.
  619. @item -provider @var{PROVIDER_CLASS_NAME}
  620. For more details @pxref{provider,, PROVIDER_CLASS_NAME}.
  621. @item -v
  622. For more details @pxref{verbose}.
  623. @end table
  624. @c man end
  625. @comment ----------------------------------------------------------------------
  626. @node Command -cacert, Command -identitydb, Command -selfcert, Add/Update Commands
  627. @comment node-name, next, previous, up
  628. @c man begin OPTIONS gkeytool
  629. @subsubsection The @option{-cacert} command
  630. 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.
  631. 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.
  632. @table @gcctabopt
  633. @item -file @var{FILE}
  634. For more details @pxref{file,, FILE}.
  635. @item -storetype @var{STORE_TYPE}
  636. For more details @pxref{storetype,, STORE_TYPE}.
  637. @item -keystore @var{URL}
  638. For more details @pxref{keystore,, URL}.
  639. @item -storepass @var{PASSWORD}
  640. For more details @pxref{storepass,, PASSWORD}.
  641. @item -provider @var{PROVIDER_CLASS_NAME}
  642. For more details @pxref{provider,, PROVIDER_CLASS_NAME}.
  643. @item -v
  644. For more details @pxref{verbose}.
  645. @end table
  646. @c man end
  647. @comment ----------------------------------------------------------------------
  648. @node Command -identitydb, , Command -cacert, Add/Update Commands
  649. @comment node-name, next, previous, up
  650. @c man begin OPTIONS gkeytool
  651. @subsubsection The @option{-identitydb} command
  652. @b{NOT IMPLEMENTED YET}.
  653. Use this command to import a JDK 1.1 style Identity Database.
  654. @table @gcctabopt
  655. @item -file @var{FILE}
  656. For more details @pxref{file,, FILE}.
  657. @item -storetype @var{STORE_TYPE}
  658. For more details @pxref{storetype,, STORE_TYPE}.
  659. @item -keystore @var{URL}
  660. For more details @pxref{keystore,, URL}.
  661. @item -storepass @var{PASSWORD}
  662. For more details @pxref{storepass,, PASSWORD}.
  663. @item -provider @var{PROVIDER_CLASS_NAME}
  664. For more details @pxref{provider,, PROVIDER_CLASS_NAME}.
  665. @item -v
  666. For more details @pxref{verbose}.
  667. @end table
  668. @c man end
  669. @comment ----------------------------------------------------------------------
  670. @node Export Commands, Display Commands, Add/Update Commands, keytool Tool
  671. @comment node-name, next, previous, up
  672. @c man begin OPTIONS gkeytool
  673. @subsection Export commands
  674. @c man end
  675. @menu
  676. * Command -certreq:: Generate Certificate Signing Requests (CSR)
  677. * Command -export:: Export a certificate in a Key Store
  678. @end menu
  679. @comment ----------------------------------------------------------------------
  680. @node Command -certreq, Command -export, Export Commands, Export Commands
  681. @comment node-name, next, previous, up
  682. @c man begin OPTIONS gkeytool
  683. @subsubsection The @option{-certreq} command
  684. 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:
  685. @example
  686. -----BEGIN NEW CERTIFICATE REQUEST-----
  687. MI...QAwXzEUMBIGA1UEAwwLcnNuQGdudS5vcmcxGzAZBgNVBAoMElUg
  688. Q2...A0GA1UEBwwGU3lkbmV5MQwwCgYDVQQIDANOU1cxCzAJBgNVBACC
  689. ...
  690. FC...IVwNVOfQLRX+O5kAhQ/a4RTZme2L8PnpvgRwrf7Eg8D6w==
  691. -----END NEW CERTIFICATE REQUEST-----
  692. @end example
  693. @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.
  694. @table @gcctabopt
  695. @item -alias @var{ALIAS}
  696. For more details @pxref{alias,, ALIAS}.
  697. @item -sigalg @var{ALGORITHM}
  698. 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.
  699. @item -file @var{FILE}
  700. For more details @pxref{file,, FILE}.
  701. @item -keypass @var{PASSWORD}
  702. Use this option to specify the password which the tool will use to unlock the @i{Key Entry} associated with the designated @i{Alias}.
  703. 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.
  704. @item -storetype @var{STORE_TYPE}
  705. For more details @pxref{storetype,, STORE_TYPE}.
  706. @item -keystore @var{URL}
  707. For more details @pxref{keystore,, URL}.
  708. @item -storepass @var{PASSWORD}
  709. For more details @pxref{storepass,, PASSWORD}.
  710. @item -provider @var{PROVIDER_CLASS_NAME}
  711. For more details @pxref{provider,, PROVIDER_CLASS_NAME}.
  712. @item -v
  713. For more details @pxref{verbose}.
  714. @item -attributes
  715. 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.
  716. @end table
  717. @c man end
  718. @comment ----------------------------------------------------------------------
  719. @node Command -export, , Command -certreq, Export Commands
  720. @comment node-name, next, previous, up
  721. @c man begin OPTIONS gkeytool
  722. @subsubsection The @option{-export} command
  723. 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).
  724. @table @gcctabopt
  725. @item -alias @var{ALIAS}
  726. For more details @pxref{alias,, ALIAS}.
  727. @item -file @var{FILE}
  728. For more details @pxref{file,, FILE}.
  729. @item -storetype @var{STORE_TYPE}
  730. For more details @pxref{storetype,, STORE_TYPE}.
  731. @item -keystore @var{URL}
  732. For more details @pxref{keystore,, URL}.
  733. @item -storepass @var{PASSWORD}
  734. For more details @pxref{storepass,, PASSWORD}.
  735. @item -provider @var{PROVIDER_CLASS_NAME}
  736. For more details @pxref{provider,, PROVIDER_CLASS_NAME}.
  737. @item -rfc
  738. Use RFC-1421 specifications when encoding the output.
  739. @item -v
  740. 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.
  741. @end table
  742. @c man end
  743. @comment ----------------------------------------------------------------------
  744. @node Display Commands, Management Commands, Export Commands, keytool Tool
  745. @comment node-name, next, previous, up
  746. @c man begin OPTIONS gkeytool
  747. @subsection Display commands
  748. @c man end
  749. @menu
  750. * Command -list:: Display information about one or all Aliases
  751. * Command -printcert:: Print a certificate or a certificate fingerprint
  752. @end menu
  753. @comment ----------------------------------------------------------------------
  754. @node Command -list, Command -printcert, Display Commands, Display Commands
  755. @comment node-name, next, previous, up
  756. @c man begin OPTIONS gkeytool
  757. @subsubsection The @option{-list} command
  758. 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.
  759. @table @gcctabopt
  760. @item -alias @var{ALIAS}
  761. If this option is omitted, the tool will print ALL the entries found in the key store.
  762. For more details @pxref{alias,, ALIAS}.
  763. @item -storetype @var{STORE_TYPE}
  764. For more details @pxref{storetype,, STORE_TYPE}.
  765. @item -keystore @var{URL}
  766. For more details @pxref{keystore,, URL}.
  767. @item -storepass @var{PASSWORD}
  768. For more details @pxref{storepass,, PASSWORD}.
  769. @item -provider @var{PROVIDER_CLASS_NAME}
  770. For more details @pxref{provider,, PROVIDER_CLASS_NAME}.
  771. @item -rfc
  772. Use RFC-1421 specifications when encoding the output.
  773. @item -v
  774. 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.
  775. @end table
  776. @c man end
  777. @comment ----------------------------------------------------------------------
  778. @node Command -printcert, , Command -list, Display Commands
  779. @comment node-name, next, previous, up
  780. @c man begin OPTIONS gkeytool
  781. @subsubsection The @option{-printcert} command
  782. Use this command to read a certificate from a designated input source and print it to @code{STDOUT} in a human-readable form.
  783. @table @gcctabopt
  784. @item -file @var{FILE}
  785. For more details @pxref{file,, FILE}.
  786. @item -v
  787. For more details @pxref{verbose}.
  788. @end table
  789. @c man end
  790. @comment ----------------------------------------------------------------------
  791. @node Management Commands, , Display Commands, keytool Tool
  792. @comment node-name, next, previous, up
  793. @c man begin OPTIONS gkeytool
  794. @subsection Management commands
  795. @c man end
  796. @menu
  797. * Command -keyclone:: Clone a Key Entry in a Key Store
  798. * Command -storepasswd:: Change the password protecting a Key Store
  799. * Command -keypasswd:: Change the password protecting a Key Entry
  800. * Command -delete:: Remove an entry in a Key Store
  801. @end menu
  802. @comment ----------------------------------------------------------------------
  803. @node Command -keyclone, Command -storepasswd, Management Commands, Management Commands
  804. @comment node-name, next, previous, up
  805. @c man begin OPTIONS gkeytool
  806. @subsubsection The @option{-keyclone} command
  807. 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.
  808. @table @gcctabopt
  809. @item -alias @var{ALIAS}
  810. For more details @pxref{alias,, ALIAS}.
  811. @item -dest @var{ALIAS}
  812. Use this option to specify the new @i{Alias} which will be used to identify the cloned copy of the @i{Key Entry}.
  813. @item -keypass @var{PASSWORD}
  814. Use this option to specify the password which the tool will use to unlock the @i{Key Entry} associated with the designated @i{Alias}.
  815. 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.
  816. @item -new @var{PASSWORD}
  817. Use this option to specify the password protecting the private key material of the newly cloned copy of the @i{Key Entry}.
  818. @item -storetype @var{STORE_TYPE}
  819. For more details @pxref{storetype,, STORE_TYPE}.
  820. @item -keystore @var{URL}
  821. For more details @pxref{keystore,, URL}.
  822. @item -storepass @var{PASSWORD}
  823. For more details @pxref{storepass,, PASSWORD}.
  824. @item -provider @var{PROVIDER_CLASS_NAME}
  825. For more details @pxref{provider,, PROVIDER_CLASS_NAME}.
  826. @item -v
  827. For more details @pxref{verbose}.
  828. @end table
  829. @c man end
  830. @comment ----------------------------------------------------------------------
  831. @node Command -storepasswd, Command -keypasswd, Command -keyclone, Management Commands
  832. @comment node-name, next, previous, up
  833. @c man begin OPTIONS gkeytool
  834. @subsubsection The @option{-storepasswd} command
  835. Use this command to change the password protecting a key store.
  836. @table @gcctabopt
  837. @item -new @var{PASSWORD}
  838. The new, and different, password which will be used to protect the designated key store.
  839. @item -storetype @var{STORE_TYPE}
  840. For more details @pxref{storetype,, STORE_TYPE}.
  841. @item -keystore @var{URL}
  842. For more details @pxref{keystore,, URL}.
  843. @item -storepass @var{PASSWORD}
  844. For more details @pxref{storepass,, PASSWORD}.
  845. @item -provider @var{PROVIDER_CLASS_NAME}
  846. For more details @pxref{provider,, PROVIDER_CLASS_NAME}.
  847. @item -v
  848. For more details @pxref{verbose}.
  849. @end table
  850. @c man end
  851. @comment ----------------------------------------------------------------------
  852. @node Command -keypasswd, Command -delete, Command -storepasswd, Management Commands
  853. @comment node-name, next, previous, up
  854. @c man begin OPTIONS gkeytool
  855. @subsubsection The @option{-keypasswd} command
  856. Use this command to change the password protecting the private key material of a designated @i{Key Entry}.
  857. @table @gcctabopt
  858. @item -alias @var{ALIAS}
  859. For more details @pxref{alias,, ALIAS}.
  860. Use this option to specify the password which the tool will use to unlock the @i{Key Entry} associated with the designated @i{Alias}.
  861. 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.
  862. @item -new @var{PASSWORD}
  863. The new, and different, password which will be used to protect the private key material of the designated @i{Key Entry}.
  864. @item -storetype @var{STORE_TYPE}
  865. For more details @pxref{storetype,, STORE_TYPE}.
  866. @item -keystore @var{URL}
  867. For more details @pxref{keystore,, URL}.
  868. @item -storepass @var{PASSWORD}
  869. For more details @pxref{storepass,, PASSWORD}.
  870. @item -provider @var{PROVIDER_CLASS_NAME}
  871. For more details @pxref{provider,, PROVIDER_CLASS_NAME}.
  872. @item -v
  873. For more details @pxref{verbose}.
  874. @end table
  875. @c man end
  876. @comment ----------------------------------------------------------------------
  877. @node Command -delete, , Command -keypasswd, Management Commands
  878. @comment node-name, next, previous, up
  879. @c man begin OPTIONS gkeytool
  880. @subsubsection The @option{-delete} command
  881. Use this command to delete a designated key store entry.
  882. @table @gcctabopt
  883. @item -alias @var{ALIAS}
  884. For more details @pxref{alias,, ALIAS}.
  885. @item -storetype @var{STORE_TYPE}
  886. For more details @pxref{storetype,, STORE_TYPE}.
  887. @item -keystore @var{URL}
  888. For more details @pxref{keystore,, URL}.
  889. @item -storepass @var{PASSWORD}
  890. For more details @pxref{storepass,, PASSWORD}.
  891. @item -provider @var{PROVIDER_CLASS_NAME}
  892. For more details @pxref{provider,, PROVIDER_CLASS_NAME}.
  893. @item -v
  894. For more details @pxref{verbose}.
  895. @end table
  896. @c man end
  897. @comment ----------------------------------------------------------------------
  898. @node Other Tools, I18N Issues, Security Tools, Top
  899. @comment node-name, next, previous, up
  900. @chapter Other Tools
  901. This is a list of currently undocumented classpath tools: @b{jar},
  902. @b{javah}, @b{gcjh}, @b{native2ascii}, @b{orbd}, @b{serialver}, @b{rmid}, @b{rmiregistry}
  903. and @b{tnameserv}.
  904. @menu
  905. * jar Tool:: Archive tool for Java archives
  906. * javah Tool:: A java header compiler
  907. * gcjh Tool:: A java header compiler (old version)
  908. * native2ascii Tool:: An encoding converter
  909. * orbd Tool:: An object request broker daemon
  910. * serialver Tool:: A serial version command
  911. * rmid Tool:: RMI activation daemon
  912. * rmiregistry Tool:: Remote object registry
  913. * tnameserv Tool:: Naming service
  914. * gjdoc Tool:: A documentation generator
  915. @end menu
  916. @comment ----------------------------------------------------------------------
  917. @node jar Tool, javah Tool, , Other Tools
  918. @comment node-name, next, previous, up
  919. @section The @command{jar} Tool
  920. @c man title gjar - Archive tool for Java archives
  921. @c man begin DESCRIPTION gjar
  922. @command{gjar} is an implementation of Sun's jar utility that comes with
  923. the JDK.
  924. If any file is a directory then it is processed recursively. The
  925. manifest file name and the archive file name needs to be specified in
  926. the same order the @option{-m} and @option{-f} flags are specified.
  927. @c man end
  928. @ignore
  929. @c man begin SYNOPSIS gjar
  930. gjar @option{-ctxui} [@var{OPTIONS}] @var{jar-file} [@option{-C} @var{DIR} @var{FILE}] @var{FILE}@dots{}
  931. @c man end
  932. @end ignore
  933. @c man begin OPTIONS gjar
  934. Operation mode:
  935. @table @gcctabopt
  936. @item -c
  937. Create new archive.
  938. @item -t
  939. List table of contents for archive.
  940. @item -x
  941. Extract named (or all) files from archive.
  942. @item -u
  943. Update existing archive.
  944. @item -i @var{FILE}
  945. Compute archive index.
  946. @end table
  947. Operation modifiers:
  948. @table @gcctabopt
  949. @item -f @var{FILE}
  950. Specify archive file name.
  951. @item -0
  952. Store only; use no ZIP compression.
  953. @item -v
  954. Generate verbose output on standard output.
  955. @item -M
  956. Do not create a manifest file for the entries.
  957. @item -m @var{manifest}
  958. Include manifest information from specified @var{manifest} file.
  959. @end table
  960. File name selection:
  961. @table @gcctabopt
  962. @item -C @var{DIR} @var{FILE}
  963. Change to the @var{DIR} and include the following @var{FILE}.
  964. @item -@@
  965. Read the names of the files to add to the archive from stdin. This
  966. option is supported only in combination with @option{-c} or @option{-u}.
  967. Non standard option added in the GCC version.
  968. @end table
  969. Standard options:
  970. @table @gcctabopt
  971. @item -help
  972. Print help text, then exit.
  973. @item -version
  974. Print version number, then exit.
  975. @item -J@var{OPTION}
  976. Pass argument to the Java runtime.
  977. @end table
  978. @c man end
  979. @c man begin SEEALSO gjar
  980. java(1), @dots{}
  981. @c man end
  982. @comment ----------------------------------------------------------------------
  983. @node javah Tool, gcjh Tool, jar Tool, Other Tools
  984. @comment node-name, next, previous, up
  985. @section The @command{javah} Tool
  986. @c man title gjavah - generate header files from Java class files
  987. @c man begin DESCRIPTION gjavah
  988. The @command{gjavah} program is used to generate header files from class
  989. files. It can generate both CNI and JNI header files, as well as stub
  990. implementation files which can be used as a basis for implementing the
  991. required native methods.
  992. @c man end
  993. @ignore
  994. @c man begin SYNOPSIS gjavah
  995. gjavah @dots{}
  996. @c man end
  997. @end ignore
  998. @c man begin OPTIONS gjavah
  999. @table @gcctabopt
  1000. @item -d @var{DIR}
  1001. Set output directory.
  1002. @item -o @var{FILE}
  1003. Set output file (only one of @option{-d} or @option{-o} may be used).
  1004. @item -cmdfile @var{FILE}
  1005. Read command file.
  1006. @item -all @var{DIR}
  1007. Operate on all class files under directory @var{DIR}.
  1008. @item -stubs
  1009. Emit stub implementation.
  1010. @item -jni
  1011. Emit JNI stubs or header (default).
  1012. @item -cni
  1013. Emit CNI stubs or header (default JNI).
  1014. @item -verbose
  1015. Set verbose mode.
  1016. @item -force
  1017. Output files should always be written.
  1018. @end table
  1019. Class path options:
  1020. @table @gcctabopt
  1021. @item -classpath @var{PATH}
  1022. Set the class path.
  1023. @item -I@var{DIR}
  1024. Add directory to class path.
  1025. @item -bootclasspath @var{PATH}
  1026. Set the boot class path.
  1027. @item -extdirs @var{PATH}
  1028. Set the extension directory path.
  1029. @end table
  1030. Standard options:
  1031. @table @gcctabopt
  1032. @item -help
  1033. Print help text, then exit.
  1034. @item -version
  1035. Print version number, then exit.
  1036. @item -J@var{OPTION}
  1037. Pass argument to the Java runtime.
  1038. @end table
  1039. @c man end
  1040. @c man begin SEEALSO gjavah
  1041. javac(1), @dots{}
  1042. @c man end
  1043. @comment ----------------------------------------------------------------------
  1044. @node gcjh Tool, native2ascii Tool, javah Tool, Other Tools
  1045. @comment node-name, next, previous, up
  1046. @section The @command{gcjh} Tool
  1047. @c man title gcjh - generate header files from Java class files
  1048. @c man begin DESCRIPTION gcjh
  1049. The @code{gcjh} program is used to generate header files from class
  1050. files. It can generate both CNI and JNI header files, as well as stub
  1051. implementation files which can be used as a basis for implementing the
  1052. required native methods. It is similar to @code{javah} but has
  1053. slightly different command line options, and defaults to CNI.
  1054. @c man end
  1055. @ignore
  1056. @c man begin SYNOPSIS gcjh
  1057. gcjh [@var{OPTIONS}]@dots{} @var{CLASS}@dots{}
  1058. @c man end
  1059. @end ignore
  1060. @c man begin OPTIONS gcjh
  1061. See @code{javah} for a full description; this page only lists the
  1062. additional options provided by @code{gcjh}.
  1063. CNI text options
  1064. @table @gcctabopt
  1065. @item -add @var{text}
  1066. Insert @var{text} into class body.
  1067. @item -append @var{text}
  1068. Append @var{text} after class declaration.
  1069. @item -friend @var{text}
  1070. Insert @var{text} as a @code{friend} declaration.
  1071. @item -prepend @var{text}
  1072. Insert @var{text} before start of class.
  1073. @end table
  1074. Compatibility options (unused)
  1075. @table @gcctabopt
  1076. @item -td @var{DIR}
  1077. @itemx -M
  1078. @itemx -MM
  1079. @itemx -MD
  1080. @itemx -MMD
  1081. Unused compatibility option.
  1082. @end table
  1083. Standard options:
  1084. @table @gcctabopt
  1085. @item -help
  1086. Print help text, then exit.
  1087. @item -version
  1088. Print version number, then exit.
  1089. @item -J@var{OPTION}
  1090. Pass argument to the Java runtime.
  1091. @end table
  1092. @c man end
  1093. @c man begin SEEALSO gcjh
  1094. javac(1), javah(1), @dots{}
  1095. @c man end
  1096. @comment ----------------------------------------------------------------------
  1097. @node native2ascii Tool, orbd Tool, gcjh Tool, Other Tools
  1098. @comment node-name, next, previous, up
  1099. @section The @command{native2ascii} Tool
  1100. @c man title gnative2ascii - An encoding converter
  1101. @c man begin DESCRIPTION gnative2ascii
  1102. To be written @dots{}
  1103. @c man end
  1104. @ignore
  1105. @c man begin SYNOPSIS gnative2ascii
  1106. gnative2ascii [@var{OPTIONS}]@dots{} [@var{INPUTFILE} [@var{OUTPUTFILE}]]
  1107. @c man end
  1108. @end ignore
  1109. @c man begin OPTIONS gnative2ascii
  1110. @table @gcctabopt
  1111. @item -encoding @var{NAME}
  1112. Set the encoding to use.
  1113. @item -reversed
  1114. Convert from encoding to native.
  1115. @end table
  1116. Standard options:
  1117. @table @gcctabopt
  1118. @item -help
  1119. Print help text, then exit.
  1120. @item -version
  1121. Print version number, then exit.
  1122. @item -J@var{OPTION}
  1123. Pass argument to the Java runtime.
  1124. @end table
  1125. @c man end
  1126. @c man begin SEEALSO gnative2ascii
  1127. javac(1), @dots{}
  1128. @c man end
  1129. @comment ----------------------------------------------------------------------
  1130. @node orbd Tool, serialver Tool, native2ascii Tool, Other Tools
  1131. @comment node-name, next, previous, up
  1132. @section The @command{orbd} object request broker daemon
  1133. @c man title gorbd - An object request broker daemon
  1134. @c man begin DESCRIPTION gorbd
  1135. To be written @dots{}
  1136. @c man end
  1137. @ignore
  1138. @c man begin SYNOPSIS gorbd
  1139. gorbd @dots{}
  1140. @c man end
  1141. @end ignore
  1142. @c man begin OPTIONS gorbd
  1143. @table @gcctabopt
  1144. @item -ORBInitialPort @var{PORT}
  1145. Port on which persistent naming service is to be started.
  1146. @item -ior @var{FILE}
  1147. File in which to store persistent naming service's IOR reference
  1148. @item -directory @var{DIR}
  1149. Directory in which to store persistent data.
  1150. @item -restart
  1151. Restart persistent naming service, clearing persistent naming
  1152. database.
  1153. @end table
  1154. Standard options:
  1155. @table @gcctabopt
  1156. @item -help
  1157. Print help text, then exit.
  1158. @item -version
  1159. Print version number, then exit.
  1160. @item -J@var{OPTION}
  1161. Pass argument to the Java runtime.
  1162. @end table
  1163. @c man end
  1164. @c man begin SEEALSO gorbd
  1165. java(1), @dots{}
  1166. @c man end
  1167. @comment ----------------------------------------------------------------------
  1168. @node serialver Tool, rmid Tool, orbd Tool, Other Tools
  1169. @comment node-name, next, previous, up
  1170. @section The @command{serialver} version command
  1171. @c man title gserialver version command
  1172. @c man begin DESCRIPTION gserialver
  1173. Print the serialVersionUID of the specified classes.
  1174. @c man end
  1175. @ignore
  1176. @c man begin SYNOPSIS gserialver
  1177. gserialver [@var{OPTIONS}]@dots{} @var{CLASS}@dots{}
  1178. @c man end
  1179. @end ignore
  1180. @c man begin OPTIONS gserialver
  1181. @table @gcctabopt
  1182. @item -classpath @var{PATH}
  1183. Class path to use to find classes.
  1184. @end table
  1185. Standard options:
  1186. @table @gcctabopt
  1187. @item -help
  1188. Print help text, then exit.
  1189. @item -version
  1190. Print version number, then exit.
  1191. @item -J@var{OPTION}
  1192. Pass argument to the Java runtime.
  1193. @end table
  1194. @c man end
  1195. @c man begin SEEALSO gserialver
  1196. javac(1), @dots{}
  1197. @c man end
  1198. @comment ----------------------------------------------------------------------
  1199. @node rmid Tool, rmiregistry Tool, serialver Tool, Other Tools
  1200. @comment node-name, next, previous, up
  1201. @section The @command{rmid} RMI activation system daemon
  1202. @c man title grmid - RMI activation system daemon
  1203. @c man begin DESCRIPTION grmid
  1204. @command{rmiregistry} starts a remote object registry on the current
  1205. host. If no port number is specified, then port 1099 is used.
  1206. @c man end
  1207. @ignore
  1208. @c man begin SYNOPSIS grmid
  1209. grmid [@var{OPTIONS}]@dots{}
  1210. @c man end
  1211. @end ignore
  1212. @c man begin OPTIONS grmid
  1213. Activation process control:
  1214. @table @gcctabopt
  1215. @item -port @var{PORT}
  1216. Port on which activation system is to be started.
  1217. @item -restart
  1218. Restart activation system, clearing persistent naming database, if
  1219. any.
  1220. @item -stop
  1221. Stop activation system.
  1222. @end table
  1223. Persistence:
  1224. @table @gcctabopt
  1225. @item -persistent
  1226. Make activation system persistent.
  1227. @item -directory @var{DIR}
  1228. Directory in which to store persistent data.
  1229. @end table
  1230. Debugging:
  1231. @table @gcctabopt
  1232. @item -verbose
  1233. Log binding events to standard out.
  1234. @end table
  1235. Standard options:
  1236. @table @gcctabopt
  1237. @item -help
  1238. Print help text, then exit.
  1239. @item -version
  1240. Print version number, then exit.
  1241. @item -J@var{OPTION}
  1242. Pass argument to the Java runtime.
  1243. @end table
  1244. @c man end
  1245. @c man begin SEEALSO grmid
  1246. java(1), @dots{}
  1247. @c man end
  1248. @comment ----------------------------------------------------------------------
  1249. @node rmiregistry Tool, tnameserv Tool, rmid Tool, Other Tools
  1250. @comment node-name, next, previous, up
  1251. @section The @command{rmiregistry} Tool
  1252. @c man title grmiregistry - Remote object registry
  1253. @c man begin DESCRIPTION grmiregistry
  1254. @command{grmiregistry} starts a remote object registry on the current
  1255. host. If no port number is specified, then port 1099 is used.
  1256. @c man end
  1257. @ignore
  1258. @c man begin SYNOPSIS grmiregistry
  1259. grmiregistry [@var{OPTIONS}]@dots{} @var{PORT}
  1260. @c man end
  1261. @end ignore
  1262. @c man begin OPTIONS grmiregistry
  1263. Registry process control:
  1264. @table @gcctabopt
  1265. @item -restart
  1266. Restart RMI naming service, clearing persistent naming database, if
  1267. any.
  1268. @item -stop
  1269. Stop RMI naming service.
  1270. @end table
  1271. Persistence:
  1272. @table @gcctabopt
  1273. @item -persistent
  1274. Make RMI naming service persistent.
  1275. @item -directory @var{DIR}
  1276. Directory in which to store persistent data.
  1277. @end table
  1278. Debugging:
  1279. @table @gcctabopt
  1280. @item -verbose
  1281. Log binding events to standard out.
  1282. @end table
  1283. Standard options:
  1284. @table @gcctabopt
  1285. @item -help
  1286. Print help text, then exit.
  1287. @item -version
  1288. Print version number, then exit.
  1289. @item -J@var{OPTION}
  1290. Pass argument to the Java runtime.
  1291. @end table
  1292. @c man end
  1293. @c man begin SEEALSO grmiregistry
  1294. java(1), @dots{}
  1295. @c man end
  1296. @comment ----------------------------------------------------------------------
  1297. @node tnameserv Tool, gjdoc Tool, rmiregistry Tool, Other Tools
  1298. @comment node-name, next, previous, up
  1299. @section The @command{tnameserv} Tool
  1300. @c man title gtnameserv Naming service
  1301. @c man begin DESCRIPTION gtnameserv
  1302. To be written @dots{}
  1303. @c man end
  1304. @ignore
  1305. @c man begin SYNOPSIS gtnameserv
  1306. tnameserv [@var{OPTIONS}]
  1307. @c man end
  1308. @end ignore
  1309. @c man begin OPTIONS gtnameserv
  1310. @table @gcctabopt
  1311. @item -ORBInitialPort @var{PORT}
  1312. Port on which naming service is to be started.
  1313. @item -ior @var{FILE}
  1314. File in which to store naming service's IOR reference.
  1315. @end table
  1316. Standard options:
  1317. @table @gcctabopt
  1318. @item -help
  1319. Print help text, then exit.
  1320. @item -version
  1321. Print version number, then exit.
  1322. @item -J@var{OPTION}
  1323. Pass argument to the Java runtime.
  1324. @end table
  1325. @c man end
  1326. @c man begin SEEALSO gtnameserv
  1327. java(1), @dots{}
  1328. @c man end
  1329. @comment ----------------------------------------------------------------------
  1330. @ignore
  1331. @c man begin SYNOPSIS gjdoc
  1332. gjdoc [@option{-sourcepath }@var{pathlist}]
  1333. [@option{-all}] [@option{-subpackages }@var{pkg:pkg:@dots{}}] [@option{-exclude }@var{pkglist}]
  1334. [@option{-encoding }@var{charset}] [@option{-locale }@var{name}] [@option{-source }@var{release}]
  1335. [@option{-public}] [@option{-protected}] [@option{-package}] [@option{-private}]
  1336. [@option{-doctitle }@var{text}] [@option{-header }@var{text}] [@option{-footer }@var{text}] [@option{-bottom }@var{text}]
  1337. [@option{-link }@var{url}] [@option{-linkoffline }@var{url} @var{path}] [@option{-noqualifier }@var{pkg:pkg:@dots{}}]
  1338. [@option{-tagletpath }@var{pathlist}] [@option{-taglet }@var{className}] [@option{-tag }@var{tagspec}]
  1339. [@option{-use}] [@option{-linksource}] [@option{-splitindex}] [@option{-noindex}] [@option{-notree}]
  1340. [@option{-version}] [@option{-author}] [@option{-nosince}] [@option{-addstylesheet }@var{file}]
  1341. [@option{-d }@var{targetdir}]
  1342. [@var{packages}@dots{}] [@var{sourcefiles}@dots{}] [@@@var{cmdfile}]
  1343. gjdoc [@option{-sourcepath }@var{pathlist}]
  1344. [@option{-all}] [@option{-subpackages }@var{pkg:pkg:@dots{}}] [@option{-exclude }@var{pkglist}]
  1345. [@option{-encoding }@var{charset}] [@option{-locale }@var{name}] [@option{-source }@var{release}]
  1346. [@option{-public}] [@option{-protected}] [@option{-package}] [@option{-private}]
  1347. [@option{-docletpath }@var{pathlist}] [@option{-doclet }@var{className}]
  1348. [@var{packages}@dots{}] [@var{sourcefiles}@dots{}] [@@@var{cmdfile}]
  1349. [doclet options]
  1350. gjdoc @option{--help}
  1351. gjdoc @option{--version}
  1352. Only the most useful options are listed here; see below for the
  1353. remainder.
  1354. @c man end
  1355. @end ignore
  1356. @c man begin SEEALSO gjdoc
  1357. Info entry for @file{gjdoc}.
  1358. @c man end
  1359. @c man begin BUGS gjdoc
  1360. Please report bugs to @w{@uref{http://savannah.gnu.org/bugs/?group=classpath}}.
  1361. @c man end
  1362. @c man begin AUTHOR gjdoc
  1363. Julian Scheid
  1364. @c man end
  1365. @node gjdoc Tool, , tnameserv Tool, Other Tools
  1366. @chapter Generating HTML Documentation
  1367. @cindex Gjdoc command options
  1368. @cindex command options
  1369. @cindex options, Gjdoc command
  1370. @c man begin DESCRIPTION gjdoc
  1371. Gjdoc can be used in two ways: as a stand-alone documentation tool, or
  1372. as a driver for a user-specified Doclet. @xref{Other Doclets}.
  1373. In the default mode, Gjdoc will use the Standard Doclet
  1374. @samp{HtmlDoclet} to generate a set of HTML pages. The canonical
  1375. usage is:
  1376. @smallexample
  1377. gjdoc -s src/java/ -all -d api-docs/
  1378. @end smallexample
  1379. Here, @samp{src/java/} is the root of your source code class
  1380. hierarchy, @option{-all} means that all valid Java files found under
  1381. this root directory should be processed, and @samp{api-docs/} is the
  1382. directory where the generated documentation should be placed.
  1383. To learn more about running Doclets other than the Standard Doclet,
  1384. refer to the manual. @xref{Invoking a Custom Doclet}.
  1385. @menu
  1386. * Invoking the Standard Doclet:: How to generate HTML documentation.
  1387. * Invoking a Custom Doclet:: How to run third-party and other
  1388. built-in Doclets.
  1389. * Option Summary by Type:: Brief list of all options, grouped by type.
  1390. * Gjdoc Option Summary:: List of all options accepted by Gjdoc.
  1391. * Source Set Options:: Select the set of source codes to run Gjdoc on.
  1392. * Source Format Options:: Specify the format of the source codes to document.
  1393. * Interlinking Options:: Connection your documentation with other projects.
  1394. * Output Control Options:: Specify the target directory and locale, and more.
  1395. * Generation Options:: Select which pieces of information to generate.
  1396. * Decoration Options:: Add or modify some titles, headers and footers or
  1397. override/amend static resources like stylesheets.
  1398. * Taglet Options:: Define your own javadoc @@tags
  1399. * Virtual Machine Options::
  1400. * Verbosity Options::
  1401. * Doclet Options::
  1402. * Other Doclets:: Generating Other Output Types
  1403. * Gjdoc Concepts:: Advanced Concepts
  1404. @end menu
  1405. @c man end
  1406. @comment ----------------------------------------------------------------------
  1407. @node Invoking the Standard Doclet, Invoking a Custom Doclet, , gjdoc Tool
  1408. @section Invoking the Standard Doclet
  1409. @cindex Gjdoc command options
  1410. @cindex command options
  1411. @cindex options, Gjdoc command
  1412. Running the Gjdoc Standard Doclet @samp{HtmlDoclet} is the default
  1413. mode of operation for Gjdoc. This section lists the command line
  1414. options you can specify in this mode. It doesn't distinguish between
  1415. general Gjdoc options and options specific to the Standard Doclet.
  1416. If you want to learn which options are accepted when Gjdoc is used as
  1417. a doclet driver, @xref{Invoking a Custom Doclet}.
  1418. @menu
  1419. * Source Set Options:: Select the set of source codes to run Gjdoc on.
  1420. * Source Format Options:: Specify the format of the source codes to document.
  1421. * Output Control Options:: Specify the target directory and locale, and more.
  1422. * Generation Options:: Select which pieces of information to generate.
  1423. * Decoration Options:: Add or modify some titles, headers and footers or
  1424. override/amend static resources like stylesheets.
  1425. * Taglet Options:: Define your own javadoc @@tags
  1426. * Virtual Machine Options::
  1427. * Doclet Options::
  1428. @end menu
  1429. @c man begin OPTIONS gjdoc
  1430. @node Option Summary by Type, Gjdoc Option Summary, Invoking a Custom Doclet, gjdoc Tool
  1431. @section Option Summary by Type
  1432. Here is a summary of all the options of both Gjdoc and the Standard
  1433. Doclet, grouped by type. Explanations are in the following sections.
  1434. @table @emph
  1435. @item Source Set Options
  1436. @xref{Source Set Options,,Options For Specifying the Source Files To Operate on}.
  1437. @gccoptlist{-sourcepath @var{pathlist} -subpackages @var{pkglist} -exclude @var{pkglist}}
  1438. @item Source Format Options
  1439. @xref{Source Format Options,,Options For Specifying the Source Format}.
  1440. @gccoptlist{-source @var{release} -encoding @var{encoding} -breakiterator}
  1441. @item Interlinking Options
  1442. @xref{Interlinking Options,,Options For Specifying the Source Files To Operate on}.
  1443. @gccoptlist{-link @var{url} -linkoffline @var{url} @var{file} -noqualifier @var{pkg:pkg:...}}
  1444. @item Generation Options
  1445. @xref{Generation Options,,Options Controlling What is Included in the Output}.
  1446. @gccoptlist{-author -licensetext -use -version -splitindex -noindex
  1447. -nodeprecated -nodeprecatedlist -nohelp -nonavbar
  1448. -nosince -notree -public -protected -package -private
  1449. -docfilessubdirs -excludedocfilessubdir @var{dirname}
  1450. -linksource}
  1451. @item Output Options
  1452. @xref{Generation Options,,Options Controlling the Output}.
  1453. @gccoptlist{-d -locale @var{name} -charset @var{charset} -docencoding @var{charset}
  1454. -validhtml -baseurl @var{url}}
  1455. @item Decoration Options
  1456. @gccoptlist{-windowtitle @var{text} -doctitle @var{text} -title @var{text}
  1457. -header @var{text} -footer @var{text} -bottom @var{text}
  1458. -helpfile @var{file} -stylesheetfile @var{file} -addstylesheet @var{file}
  1459. -group @var{groupheading} @var{pkgpattern:pkgpattern:@dots{}}}
  1460. @item Taglet Options
  1461. @xref{Taglet Options,,Options For Specifying user-defined Taglets}.
  1462. @gccoptlist{-tagletpath -taglet @var{classname} -tag @var{tagspec}}
  1463. @item Doclet Options
  1464. @xref{Doclet Options,,Options For Specifying the Doclet to use}.
  1465. @gccoptlist{-docletpath -doclet @var{classname}}
  1466. @item Verbosity Options
  1467. @xref{Verbosity Options,,Options Controlling Gjdoc Behavior}.
  1468. @gccoptlist{-quiet -verbose}
  1469. @item Virtual Machine Options
  1470. @xref{Virtual Machine Options,,Options Controlling Gjdoc Behavior}.
  1471. @gccoptlist{-classpath -bootclasspath -J @var{vmopt}}
  1472. @end table
  1473. @menu
  1474. * Virtual Machine Options:: Controlling the kind of output:
  1475. an executable, object files, assembler files,
  1476. or preprocessed source.
  1477. @end menu
  1478. @node Source Set Options, Source Format Options, Gjdoc Option Summary, gjdoc Tool
  1479. @section Selecting which Source Files to Process
  1480. @table @gcctabopt
  1481. @item -s @var{pathlist}
  1482. @item -sourcepath @var{pathlist}
  1483. Look for source files in the specified directory or directories.
  1484. @var{pathlist} should be one or more directory paths separated by your
  1485. platform's path separator (usually @samp{:} or @samp{;}).
  1486. If this option is not given, @command{gjdoc} will look for source
  1487. files in the current directory.
  1488. The directories specified should be root directories in terms of the
  1489. Java package system. For example, if you want to generate
  1490. documentation for classes in package @samp{foo.bar}, you must specify
  1491. the directory containing the top-level @samp{@file{foo}}
  1492. sub-directory, not the directory @samp{@file{foo/bar/}} in which the
  1493. Java source files reside.
  1494. The short-hand alias @option{-s} is specific to @command{gjdoc} and
  1495. not compatible to Sun @command{javadoc}.
  1496. @item -all
  1497. @emph{[EXPERIMENTAL]}
  1498. Process all valid Java source files found in the directories listed in
  1499. the source path and their sub-directories.
  1500. This is an option specific to @command{gjdoc} and not compatible to
  1501. Sun @command{javadoc}.
  1502. @item -subpackages @var{pkg:pkg:@dots{}}
  1503. Process the classes in the given Java packages and all sub-packages,
  1504. recursively. Note that multiple package names must be separated with
  1505. colons instead of whitespace.
  1506. @item -exclude @var{pkg:pkg:@dots{}}
  1507. Do not process classes in the given Java packages and all
  1508. sub-packages, recursively. This option can be used in conjunction
  1509. with @option{-all} or @option{-subpackages} in order to exclude
  1510. individual packages or package sub-trees from the output.
  1511. @item @var{packages}@dots{}
  1512. Process all classes in the given Java packages.
  1513. @item @var{sourcefiles}@dots{}
  1514. Process the classes in the given Java source files.
  1515. @end table
  1516. @node Source Format Options, Interlinking Options, Source Set Options, gjdoc Tool
  1517. @section Specifying the Format of Input Files
  1518. @table @gcctabopt
  1519. @item -source @var{release}
  1520. Assume that the source files are targeted at the given release of the
  1521. Java platform.
  1522. @var{release} should be the version number of a Java platform release
  1523. in the format MAJOR.MINOR, for example @samp{1.4}.
  1524. This option is currently ignored except that an error is raised if a
  1525. release number other than @samp{1.2}, @samp{1.3} or @samp{1.4} is
  1526. specified.
  1527. @item -encoding @var{charset}
  1528. Assume that the source files are encoded using @var{charset}.
  1529. Examples for @var{charset} are @samp{US-ASCII}, @samp{ISO-8859-1} or
  1530. @samp{UTF-8}.
  1531. The semantics of @var{charset} are identical to those of @samp{java.nio.charset.Charset.forName(String)}.
  1532. @item -breakiterator
  1533. Use the locale's java.text.BreakIterator instead of the internal
  1534. first sentence detector.
  1535. By default, @command{gjdoc} uses an internal algorithm to determine
  1536. where a sentence ends. When this option is given, it will instead use
  1537. the @samp{java.text.BreakIterator} instance for the locale given with
  1538. @option{-locale} (or the default locale).
  1539. This option should be specified when applying @command{gjdoc} to
  1540. source code commented in a non-latin language for which the default
  1541. first sentence detector does not work. For all other cases, the
  1542. default (do not use BreakIterator) produces better results at the time
  1543. of this writing.
  1544. @end table
  1545. @node Interlinking Options, Output Control Options, Source Format Options, gjdoc Tool
  1546. @section Interlinking with other Documentation Sets
  1547. @table @gcctabopt
  1548. @item -link @var{url}
  1549. Create hyperlinks to another documentation set.
  1550. By default, @command{gjdoc} will only create hyperlinks to classes in
  1551. the source set. Use this option to additionally create hyperlinks to
  1552. classes covered by the specified documentation set.
  1553. @var{url} should be the root URL of the other documentation set. For
  1554. example, to add hyperlinks to GNU Classpath, specify the following:
  1555. @smallexample
  1556. -link http://developer.classpath.org/doc/
  1557. @end smallexample
  1558. The @option{-link} option can be specified multiple times.
  1559. Note that specifying the @option{-link} option will cause an HTTP
  1560. access every time gjdoc is invoked. You can use @option{-linkoffline}
  1561. instead to avoid this access.
  1562. @item -linkoffline @var{url} @var{file}
  1563. Create hyperlinks to another documentation set which is also present
  1564. on the local file system.
  1565. This option works exactly like @option{-link}, except that it accesses
  1566. the local file system instead of the network for determining which
  1567. classes are covered by the linked documentation set.
  1568. When using @option{-linkoffline} the remote documentation set is not
  1569. accessed at all, which can significantly speed up generation time
  1570. depending on your network connection. The generated hyperlinks to the
  1571. documentation set however refer to the remote set, not to the local
  1572. one, so that you can distribute the documentation without any further
  1573. dependencies.
  1574. The @option{-linkoffline} option can be specified multiple times.
  1575. @item -noqualifier @var{pkg:pkg:@dots{}}
  1576. Do not qualify names of classes in the given packages with their
  1577. package name.
  1578. By default, a class name is displayed unqualified only if the class is
  1579. part of the source set or a linked documentation set, and qualified
  1580. with the name of its containing package if it is not. You can use this
  1581. option to force unqualified names for classes even if they are not
  1582. part of the documentation set.
  1583. For example, usually a reference to the String class is represented
  1584. fully-qualified as @samp{java.lang.String} (unless you link to the
  1585. appropriate documentation set using @option{-link}) because it isn't
  1586. part of the documentation set. You can specify @samp{-noqualifier
  1587. java.lang} to render the same references just as @samp{String}.
  1588. Note that for all unqualified class names, a tooltip is provided when
  1589. you place your mouse pointer over it in the HTML documentation.
  1590. @item -noqualifier @samp{all}
  1591. Omit package name qualifier from all class names.
  1592. Specify this option to omit package name qualifiers altogether,
  1593. @end table
  1594. @node Generation Options, Decoration Options, Output Control Options, gjdoc Tool
  1595. @section Selecting which Information to Generate
  1596. @table @gcctabopt
  1597. @item -public
  1598. Only include public members of public classes in the output. By
  1599. default, protected class members are included as well.
  1600. @item -protected
  1601. Include public or protected members of public classes in the output.
  1602. This is the default.
  1603. @item -package
  1604. Include public, protected and package-private members of public and
  1605. package-private classes.
  1606. @item -private
  1607. Include all classes and class members regardless of their access
  1608. level.
  1609. @item -splitindex
  1610. Generate one index page per letter instead of a single, monolithic
  1611. index page.
  1612. By default, the index created by the Standard Doclet contains all
  1613. entries on a single page. This is fine for small documentation sets,
  1614. but for large sets you should specify this option.
  1615. @item -nosince
  1616. Ignore @samp{@@since} tags in javadoc comments.
  1617. By default, the generated output contains sections listing the version
  1618. of your API since which the package, class or class member in question
  1619. exists when this tag is encountered. Specify this option to omit this
  1620. information.
  1621. @item -notree
  1622. Do not generate any tree pages.
  1623. By default, the generated output includes one inheritance tree per
  1624. package, and - if the documentation set consists of multiple packages
  1625. - a page with the full inheritance tree. Specify this option to omit
  1626. generation of these pages.
  1627. @item -noindex
  1628. Do not output the alphabetical index.
  1629. By default, gjdoc generates an alphabetical index of all program
  1630. elements in the documentation set (packages, classes, inner classes,
  1631. constructors, methods, and fields). Specify this option to omit this
  1632. information.
  1633. @item -nohelp
  1634. Do not generate the help page.
  1635. This option is currently ignored as the Standard Doclet doesn't
  1636. provide a help page.
  1637. @item -nodeprecated
  1638. Do not output inline information about deprecated packages, classes or
  1639. class members.
  1640. By default, the Standard Doclet adds a highlighted paragraph with
  1641. deprecation information to the description of each deprecated program
  1642. element. Specify this option to omit this information.
  1643. @item -nodeprecatedlist
  1644. Do not output the summary page for deprecated API elements.
  1645. By default, the Standard Doclet generates a page listing all
  1646. deprecated API elements along with a deprecation description which
  1647. usually includes the reason for deprecation and possible
  1648. alternatives. Specify this option to omit this information.
  1649. @item -nonavbar
  1650. Do not output the navigation bar, header, and footer.
  1651. By default, each output page is equipped with a top navigation bar
  1652. (which may include a user-specified header) and a bottom navigation
  1653. bar (which may include a user-specified footer). Specify this option
  1654. to omit this decoration.
  1655. @item -nocomment
  1656. Omit all documentation text from the generated files and output only
  1657. declarations and program element relationships.
  1658. This option is here for compatibility with @command{javadoc}. If you
  1659. plan on extracting information about your project via @command{gjdoc},
  1660. you should consider using a different Doclet for your purposes
  1661. instead, for example XmlDoclet. You could also use the Doclet API
  1662. directly by implementing a new Doclet.
  1663. @item -linksource
  1664. Generate a page with syntax-highlighted source code for each class.
  1665. By default, this page is not generated.
  1666. The source code can be accessed by clicking on the button labelled
  1667. "Source" in the navigation bar, or by clicking on the name of a
  1668. constructor, field, method, or inner class in the detail section of a
  1669. class documentation page.
  1670. @item -use
  1671. Generate a page with cross-reference information. By default, this
  1672. page is not generated.
  1673. The cross-reference information can be accessed by clicking on the
  1674. button labelled `Use' in the navigation bar.
  1675. The `Use' page lists all classes/interfaces in the documentation set
  1676. that extend/implement the class (type) in question; fields of the
  1677. type; methods or constructors accepting a parameter of the type;
  1678. methods returning the type; and methods or constructors throwing the
  1679. type.
  1680. @item -author
  1681. Include author information in the output.
  1682. When specified, author information as specified using the
  1683. @samp{@@author} tag in javadoc comments is incorporated into the
  1684. output. By default, @samp{@@author} tags are ignored.
  1685. @item -version
  1686. Include version information in the output.
  1687. When specified, version information as specified using the
  1688. @samp{@@version} tag in javadoc comments is incorporated into the
  1689. output. By default, @samp{@@version} tags are ignored.
  1690. @item -licensetext
  1691. Assume that the first comment in each source file contains the license
  1692. text, and add license information to the footer of each generated
  1693. class page.
  1694. This is an option specific to @command{gjdoc} and not compatible to
  1695. Sun @command{javadoc}.
  1696. This option is intended for use with free and open source projects
  1697. where source code is typically prefixed with a boilerplate license
  1698. comment, when there are legal reasons for including the license in the
  1699. documentation.
  1700. @item -docfilessubdirs
  1701. Recursively copy all files in the @file{doc-files} sub-directory of each
  1702. package directory.
  1703. Usually, only the files in the @file{doc-files} sub-directory are copied
  1704. without descending recursively.
  1705. @xref{Adding Custom Resources}.
  1706. @item -excludedocfilessubdir @var{name}:@var{name}:@dots{}
  1707. Do not copy some directories directly under the @file{doc-files}
  1708. sub-directories when descending recursively.
  1709. The argument to this option should be a colon-separated list of
  1710. directory names.
  1711. This option only makes sense if @option{-docfilessubdirs} is also
  1712. specified. In this case, any sub-directory located directly beneath a
  1713. @file{doc-files} directory is omitted if listed.
  1714. @end table
  1715. @node Taglet Options, Virtual Machine Options, Decoration Options, gjdoc Tool
  1716. @section Custom Documentation Tags
  1717. @table @gcctabopt
  1718. @item -tagletpath @var{pathlist}
  1719. Search @var{pathlist} when loading subsequent Taglet classes specified
  1720. using @option{-taglet}.
  1721. @var{pathlist} should be one or more paths to a directory or jar file,
  1722. separated by your platform's path separator (usually @samp{:} or
  1723. @samp{;}).
  1724. @item -taglet @var{classname}
  1725. Register a Taglet.
  1726. @var{classname} should be the fully-qualified name of a Java class
  1727. implementing @samp{com.sun.tools.doclets.Taglet}.
  1728. The Taglet classes will be loaded from the classpath specified using
  1729. @option{-tagletpath}, from the classpath specified using
  1730. @option{-classpath} and from the default classpath.
  1731. See the documentation of @samp{com.sun.tools.doclets.Taglet} for
  1732. further information.
  1733. Note that for simple tags, there is also @option{-tag}.
  1734. @item -tag @var{tagspec}
  1735. Register a generic Taglet.
  1736. The format of @var{tagspec} must be @samp{<tagname>:<flags>:"<taghead>"}.
  1737. @var{tagname} is the tag name to match, without the leading @@ sign.
  1738. @var{flags} is one or more of the following characters, where each
  1739. character specifies a source code context in which the tag is to be
  1740. recognized.
  1741. @table @gcctabopt
  1742. @item a
  1743. all contexts
  1744. @item c
  1745. constructors
  1746. @item f
  1747. fields
  1748. @item m
  1749. methods
  1750. @item o
  1751. overview
  1752. @item p
  1753. packages
  1754. @item t
  1755. types (classes, interfaces, exceptions, errors)
  1756. @item X
  1757. special character which temporarily disables the
  1758. Taglet altogether.
  1759. @end table
  1760. @var{taghead} is the string to display in the header of the section
  1761. devoted to the tag in question.
  1762. For example, to define a tag matching @samp{@@cvsid} which is to be
  1763. accepted in overview, package and type pages and which is labelled
  1764. with the header @samp{CVS ID}, you would specify:
  1765. @smallexample
  1766. -tag cvsid:tpo:"CVS ID"
  1767. @end smallexample
  1768. Let's say that a class javadoc comment contains
  1769. @smallexample
  1770. @@cvsid $Id: cp-tools.texinfo,v 1.9 2012-03-07 15:27:27 gnu_andrew Exp $
  1771. @end smallexample
  1772. Then the HTML output will contain something like
  1773. @smallexample
  1774. CVS ID:
  1775. $Id: cp-tools.texinfo,v 1.9 2012-03-07 15:27:27 gnu_andrew Exp $
  1776. @end smallexample
  1777. @end table
  1778. @node Doclet Options, Other Doclets, Verbosity Options, gjdoc Tool
  1779. @section Running Other Doclets
  1780. @table @gcctabopt
  1781. @item -docletpath @var{pathlist}
  1782. Search @var{pathlist} when loading classes for the Doclet specified
  1783. using @option{-doclet}.
  1784. @var{pathlist} should be one or more paths to a directory or jar file,
  1785. separated by your platform's path separator (usually @samp{:} or
  1786. @samp{;}).
  1787. @item -doclet @var{className}
  1788. Run the specified doclet instead of the standard HtmlDoclet.
  1789. @var{className} should be the fully-qualified name of a class which
  1790. has a public default constructor and contain a method with the
  1791. following signature:
  1792. @smallexample
  1793. import com.sun.javadoc.RootDoc;
  1794. public static boolean start(RootDoc rootDoc)
  1795. @end smallexample
  1796. The Doclet classes will be loaded from the classpath specified using
  1797. @option{-docletpath}, from the classpath specified using
  1798. @option{-classpath} and from the default classpath.
  1799. The @samp{start} method should process the information exposed by the
  1800. Doclet API via @samp{rootDoc} and return @samp{true} on success,
  1801. @samp{false} on failure.
  1802. If you are using a third-party doclet, refer to its documentation for
  1803. further instructions. Note that support for third-party doclets is
  1804. experimental. Please report any problems you encounter, or provide
  1805. feedback when successfully running third-party applets.
  1806. This option can be specified multiple times, in which case all doclets
  1807. are executed with the same information tree exposed via the Doclet API
  1808. for each Doclet run.
  1809. @end table
  1810. @node Decoration Options, Taglet Options, Generation Options, gjdoc Tool
  1811. @section Adding Information to the Output
  1812. @table @gcctabopt
  1813. @item -windowtitle @var{text}
  1814. Use @var{text} as the browser window title prefix.
  1815. When specified, the browser window title for each page will be
  1816. prefixed with @var{text} instead of the default string @samp{Generated
  1817. API Documentation}.
  1818. @var{text} should be plain text (it should not contain HTML tags).
  1819. @item -doctitle @var{text}
  1820. Set the header text of the overview page to @var{text}.
  1821. @var{text} should be a short plain text string.
  1822. When generating documentation for a single package, specifying this
  1823. option forces generation of the overview page.
  1824. @item -header @var{htmltext}
  1825. Add @var{htmltext} to the right upper corner of every generated page.
  1826. @var{htmltext} is usually set to the name of the project being
  1827. documented.
  1828. @item -footer @var{htmltext}
  1829. Add @var{htmltext} to the right bottom corner of every generated page.
  1830. @var{htmltext} is often set to the same value as for @option{-header}.
  1831. @item -bottom @var{htmltext}
  1832. Add @var{htmltext} to the very bottom of every generated page,
  1833. spanning the whole width of the page. When specified, @var{htmltext}
  1834. usually consists of a copyright notice and/or links to other project
  1835. pages.
  1836. @item -addstylesheet @var{file}
  1837. Augment the default CSS style sheets with the user-specified
  1838. stylesheet @var{file}.
  1839. The given stylesheet is simply loaded by each HTML page in addition to
  1840. the default ones, as the last stylesheet.
  1841. Note that the CSS cascading rules apply. That is, your style
  1842. properties will only be assigned if they have a higher cascading order
  1843. than @command{gjdoc}'s default style. One simple way to make sure
  1844. that this is the case is to declare your overrides @samp{!important}.
  1845. See @w{@uref{http://www.w3.org/TR/REC-CSS2/cascade.html#cascading-order}}.
  1846. @item -group @var{heading} @var{pkgwildcard}:@var{pkgwildcard}:@dots{}
  1847. Arrange the given packages in a separate group on the overview page.
  1848. The first argument should be a short plain text which is used as the
  1849. title of the package group. The second argument should be a
  1850. colon-separated list of package wildcards. The group will consist of
  1851. all packages in the documentation set whose name matches any of the
  1852. given wildcards.
  1853. There is only one wildcard character, @samp{*}, which matches both
  1854. letters in package name components and the @samp{.} separating package
  1855. name components. For example, @samp{j*regex} would match package
  1856. @samp{java.util.regex}. A more useful example would be
  1857. @samp{javax.swing*} to match @samp{javax.swing} and all of its
  1858. sub-packages.
  1859. This option can be given multiple times.
  1860. FIXME: Information about group nesting here.
  1861. @smallexample
  1862. gjdoc -group "Core Classes" 'java*' \
  1863. -group "Swing" 'javax.swing*' \
  1864. -group "XML APIs" 'javax.xml*' \
  1865. -group "Other Extensions" javax* \
  1866. @dots{}
  1867. @end smallexample
  1868. @item -overview @var{file}
  1869. Add the XHTML body fragment from @var{file} to the overview page.
  1870. @var{file} should contain an XHTML fragment with the HTML @samp{body}
  1871. tag as the root node. @xref{XHTML Fragments}.
  1872. This option can be used to supply a description of the documentation
  1873. set as a whole.
  1874. When specified, the first sentence of the fragment will be put above
  1875. the tables listing the documented packages, along with a link to the
  1876. full copy of the fragment which is put below the tables.
  1877. @xref{First Sentence Detector}.
  1878. When generating documentation for a single package, specifying this
  1879. option forces generation of the overview page.
  1880. @item -stylesheetfile @var{file}
  1881. Use the CSS stylesheet in @var{file} instead of the default CSS
  1882. stylesheets.
  1883. If you only want to override parts of the default stylesheets, use
  1884. @option{-addstylesheet} instead.
  1885. @item -title @var{text}
  1886. @emph{Deprecated.} Use @option{-doctitle} @var{text} instead.
  1887. @item -helpfile @var{file}
  1888. This option is currently ignored.
  1889. When implemented, it will use the XHTML fragment in @var{file} for the
  1890. help page contents instead of the default help text.
  1891. @end table
  1892. @node Output Control Options, Generation Options, Interlinking Options, gjdoc Tool
  1893. @section Controlling the Output.
  1894. @table @gcctabopt
  1895. @item -d @var{directory}
  1896. Place all output files into @var{directory} (and
  1897. sub-directories). @var{directory} will be created if it does not
  1898. exist, including all non-existing parent directories and all required
  1899. sub-directories.
  1900. If not specified, output will be placed into the current directory.
  1901. @item -locale @var{name}
  1902. Use locale @var{name} instead of the default locale for all purposes.
  1903. @var{name} should be a locale specifier in the form @samp{ll_CC[_VAR]}
  1904. where @samp{ll} is a lowercase two-letter ISO-639 language code,
  1905. @samp{CC} is an optional uppercase two-letter ISO-3166 country code,
  1906. and @samp{VAR} is an optional variant code. For example, @samp{en}
  1907. specifies English, @samp{en_US} specifies US English, and
  1908. @samp{en_US_WIN} specifies a deviant variant of the US English locale.
  1909. Note that the semantics of this option correspond exactly to those of
  1910. the constructors of class @samp{java.util.Locale}.
  1911. This option currently only determines which Collator is being used for
  1912. sorting output elements. This means that the locale will only have an
  1913. effect when you are using non-ASCII characters in identifiers.
  1914. @item -charset @var{charset}
  1915. @emph{Deprecated.} Override the specified encoding in output XHTML
  1916. files with the one given by @samp{charset}.
  1917. If this option is not given, the encoding specification in output
  1918. XHTML is chosen to match the encoding used when writing the file (the
  1919. encoding given with @option{-docencoding}, or your platform's default
  1920. encoding).
  1921. The semantics for @var{charset} are specified here:
  1922. @w{@uref{http://www.w3.org/TR/2000/REC-xml-20001006#NT-EncName}}. For
  1923. all practical purposes, they are identical to those of the other
  1924. options accepting charset parameters.
  1925. This option is here for compatibility with @command{javadoc} and
  1926. should be avoided.
  1927. @item -docencoding @var{charset}
  1928. Use the given charset encoding when writing output files instead of
  1929. your platform's default encoding.
  1930. Examples for @var{charset} are @samp{US-ASCII}, @samp{ISO-8859-1} or
  1931. @samp{UTF-8}.
  1932. The semantics of this option correspond exactly to those of the
  1933. constructors of class @samp{java.util.Locale}.
  1934. @item -validhtml
  1935. Force generation of valid XHTML code. This breaks compatibility to
  1936. the traditional Javadoc tool to some extent.
  1937. If this option is specified, anchor names will be mangled so that they
  1938. are valid according to the XHTML 1.1 specification. However, a
  1939. documentation set generated with this option cannot be linked to
  1940. properly using the traditional Javadoc tool. It can be linked to just
  1941. fine using Gjdoc, though.
  1942. Without this option, anchor names for executable class members use the
  1943. traditional format, for example: ``foo(String,int[])''. This is
  1944. compatible to the traditional Javadoc tool, but according to both the
  1945. HTML 4.0 and XHTML 1.0 and 1.1 specifications, this format includes
  1946. illegal characters. Parentheses, square brackets, and the comma are
  1947. not allowed in anchor names.
  1948. @item -baseurl @var{url}
  1949. Hardwire a page URL relative to @var{url} into each generated page.
  1950. If you are generating documentation which will exclusively be
  1951. available at a certain URL, you should use this option to specify this
  1952. URL.
  1953. This can help avoid certain redirect attacks used by spammers, and it
  1954. can be helpful for certain web clients.
  1955. @end table
  1956. @node Verbosity Options, Doclet Options, Virtual Machine Options, gjdoc Tool
  1957. @section Verbosity Options
  1958. @table @gcctabopt
  1959. @item -quiet
  1960. Suppress all output except for warnings and error messages.
  1961. @item -verbose
  1962. Be very verbose about what @command{gjdoc} is doing.
  1963. This option is currently ignored.
  1964. @end table
  1965. @node Virtual Machine Options, Verbosity Options, Taglet Options, gjdoc Tool
  1966. @section Virtual Machine Options
  1967. Sun's @command{javadoc} tool seems to be based on @command{javac} and
  1968. as such it seems to operate on the VM level. @command{gjdoc}, in
  1969. contrast, is a pure Java application.
  1970. Therefore, @command{gjdoc} can only fake, or simulate, the following
  1971. VM-level options.
  1972. @table @gcctabopt
  1973. @item -classpath @var{pathlist}
  1974. Set the Virtual Machine @samp{classpath} to @var{pathlist}.
  1975. In most cases you should use @option{-docletpath} or
  1976. @option{-tagletpath} instead of this option.
  1977. @var{pathlist} should be one or more paths to a directory or jar file,
  1978. separated by your platform's path separator (usually @samp{:} or
  1979. @samp{;}).
  1980. If this option is not intercepted at the wrapper level,
  1981. @command{gjdoc} currently fakes it by calling
  1982. @samp{System.setProperty("java.class.path", @var{pathlist});} and
  1983. outputs a warning.
  1984. @item -bootclasspath @var{pathlist}
  1985. Set the Virtual Machine @samp{bootclasspath} to @var{pathlist}.
  1986. If this option is not intercepted at the wrapper level,
  1987. @command{gjdoc} outputs a warning.
  1988. @item -J@var{vmopt}
  1989. Pass an arbitrary parameter to the Virtual Machine @command{gjdoc}
  1990. runs on.
  1991. If this option is not intercepted at the wrapper level,
  1992. @command{gjdoc} tries to emulate the option and outputs a warning.
  1993. Currently, only the VM option @option{-D} for setting system
  1994. properties is emulated.
  1995. @end table
  1996. @c man end
  1997. @comment ----------------------------------------------------------------------
  1998. @node Invoking a Custom Doclet, Option Summary by Type, Invoking the Standard Doclet, gjdoc Tool
  1999. @section Invoking a Custom Doclet
  2000. For invoking one of the other doclets shipping with @command{gjdoc} or
  2001. a third-party doclet, the canonical usage is:
  2002. @smallexample
  2003. gjdoc -s src/java/ -all \
  2004. -docletpath /path/to/doclet.jar -doclet foo.BarDoclet \
  2005. (more Gjdoc core options and Doclet-specific options here)
  2006. @end smallexample
  2007. @samp{/path/to/doclet.jar} is a placeholder for a class path
  2008. specifying where the Doclet classes and dependencies can be found and
  2009. @samp{foo.BarDoclet} is the fully-qualified name of the Doclet's main
  2010. class.
  2011. @comment ----------------------------------------------------------------------
  2012. @node Gjdoc Option Summary, Source Set Options, Option Summary by Type, gjdoc Tool
  2013. @section Gjdoc Option Summary
  2014. @cindex Gjdoc Options
  2015. @comment ----------------------------------------------------------------------
  2016. @node Other Doclets, Gjdoc Concepts, Doclet Options, gjdoc Tool
  2017. @chapter Generating Other Output Types
  2018. @menu
  2019. * Built-in Doclets::
  2020. * Third-party Doclets::
  2021. @end menu
  2022. @comment ----------------------------------------------------------------------
  2023. @node Built-in Doclets, Third-party Doclets, , Other Doclets
  2024. @section Using the Built-in Doclets
  2025. @cindex Built-in Doclets
  2026. @menu
  2027. * Using XmlDoclet::
  2028. * Using TexiDoclet::
  2029. * Using IspellDoclet::
  2030. * Using DebugDoclet::
  2031. @end menu
  2032. @comment ----------------------------------------------------------------------
  2033. @node Using TexiDoclet, Using XmlDoclet, , Built-in Doclets
  2034. @subsection TexiDoclet: Generating Info, PDF, and other formats
  2035. @cindex TexiDoclet
  2036. Missing.
  2037. @comment ----------------------------------------------------------------------
  2038. @node Using XmlDoclet, Using IspellDoclet, Using TexiDoclet, Built-in Doclets
  2039. @subsection XmlDoclet: Generating XML Documentation
  2040. @cindex HtmlDoclet
  2041. Missing.
  2042. @comment ----------------------------------------------------------------------
  2043. @node Using IspellDoclet, Using DebugDoclet, Using XmlDoclet, Built-in Doclets
  2044. @subsection IspellDoclet: Spell-checking Source Code
  2045. @cindex IspellDoclet
  2046. Missing.
  2047. @comment ----------------------------------------------------------------------
  2048. @node Using DebugDoclet, , Using IspellDoclet, Built-in Doclets
  2049. @subsection DebugDoclet: Inspecting the Doclet API
  2050. @cindex HtmlDoclet
  2051. Missing.
  2052. @comment ----------------------------------------------------------------------
  2053. @node Third-party Doclets, , Built-in Doclets, Other Doclets
  2054. @section Using Third-Party Doclets
  2055. @cindex Third-party Doclets
  2056. @menu
  2057. * DocBook Doclet::
  2058. * PDFDoclet::
  2059. * JUnitDoclet::
  2060. @end menu
  2061. @comment ----------------------------------------------------------------------
  2062. @node DocBook Doclet,PDFDoclet, ,Third-party Doclets
  2063. @subsection DocBook Doclet
  2064. @cindex DocBook Doclet
  2065. Missing.
  2066. @comment ----------------------------------------------------------------------
  2067. @node PDFDoclet, JUnitDoclet, DocBook Doclet, Third-party Doclets
  2068. @subsection PDFDoclet
  2069. @cindex PDFDoclet
  2070. Missing.
  2071. @comment ----------------------------------------------------------------------
  2072. @node JUnitDoclet, , PDFDoclet, Third-party Doclets
  2073. @subsection JUnitDoclet
  2074. @cindex JUnitDoclet
  2075. Missing.
  2076. @comment ----------------------------------------------------------------------
  2077. @node Gjdoc Concepts, , Other Doclets, gjdoc Tool
  2078. @chapter Advanced Concepts
  2079. @menu
  2080. * Writing Doclets::
  2081. * Taglets::
  2082. * XHTML Fragments::
  2083. * First Sentence Detector::
  2084. * Adding Custom Resources::
  2085. @end menu
  2086. @comment ----------------------------------------------------------------------
  2087. @node Taglets, Writing Doclets, , Gjdoc Concepts
  2088. @section Adding Custom Tags to the Documentation
  2089. @cindex Taglet
  2090. Missing.
  2091. @comment ----------------------------------------------------------------------
  2092. @node Writing Doclets, XHTML Fragments, Taglets, Gjdoc Concepts
  2093. @section Writing Doclets
  2094. @cindex Taglet
  2095. If the various Doclets already available don't suit your needs, you
  2096. can write a custom Doclet yourself.
  2097. @menu
  2098. * Doclet Invocation Interface::
  2099. * Using AbstractDoclet::
  2100. * GNU Doclet SPI::
  2101. @end menu
  2102. @comment ----------------------------------------------------------------------
  2103. @node Doclet Invocation Interface, Using AbstractDoclet, , Writing Doclets
  2104. @subsection Implementing the Doclet Invocation Interface
  2105. A Doclet is a class that contains a method with the following
  2106. signature:
  2107. @smallexample
  2108. public static boolean start(RootDoc rootDoc);
  2109. @end smallexample
  2110. @var{rootDoc} is the root of an object hierarchy containing the
  2111. information @command{gjdoc} extracted from the source files. See the
  2112. Doclet API for more details.
  2113. @samp{start} should process all the information and return
  2114. @samp{true} on success, @samp{false} on failure.
  2115. For printing status information, the Doclet should use methods
  2116. @samp{printNotice}, @samp{printWarning} and @samp{printError} instead
  2117. of @samp{System.err}. The Doclet can opt to use @samp{System.out} for
  2118. redirectable output.
  2119. @comment ----------------------------------------------------------------------
  2120. @node Using AbstractDoclet, GNU Doclet SPI, Doclet Invocation Interface, Writing Doclets
  2121. @subsection Deriving Your Doclet from AbstractDoclet
  2122. @cindex AbstractDoclet
  2123. You may want your Doclet to provide functionality similar to
  2124. HtmlDoclet. For example, you may want it to support Taglets, generate
  2125. Index, Tree, and Uses pages, or show other cross-reference information
  2126. like @samp{Overrides} and @samp{All Implementing Classes}.
  2127. This information is not directly provided by the Doclet API, so your
  2128. Doclet would normally have to assemble it itself. For example, it
  2129. would have to add the names of all program elements to a list and sort
  2130. this list in order to create the Index page.
  2131. If you want to provide this information or part of it, you should
  2132. consider deriving your class from
  2133. @samp{gnu.classpath.tools.doclets.AbstractDoclet}. This class
  2134. provides the following benefits:
  2135. @itemize @bullet
  2136. @item
  2137. Handles options @option{-tag}, @option{-taglet}, @option{-tagletpath}
  2138. (Taglets)
  2139. @item
  2140. Provides standard taglets for @@version, @@author, @@since, @@serial,
  2141. @@deprecated, @@see, @@param, @@return and handles all related options
  2142. (@option{-version}, @option{-author}, @option{-nosince},
  2143. @option{-nodeprecated})
  2144. @item
  2145. Handles option @option{-d} (destination directory)
  2146. @item
  2147. Handles option @option{-noqualifier} (classes to omit qualifier for)
  2148. @item
  2149. Handles options @option{-docfilessubdirs} and
  2150. @option{-excludedocfilessubdir} (resource copying)
  2151. @item
  2152. Can generate a full index or an index split by first letter
  2153. @item
  2154. Can generate a full tree and package trees
  2155. @item
  2156. Can generate cross-reference information
  2157. @item
  2158. Can aggregate interface information (all superinterfaces, all
  2159. subinterfaces, all implementing classes)
  2160. @item
  2161. Provides convenient access to constructors, fields, methods, and inner
  2162. classes sorted by name/signature instead of the default sort order.
  2163. @item
  2164. Provides various other convenience methods
  2165. @end itemize
  2166. If you derive from @samp{AbstractDoclet}, there are a number of things
  2167. you need to take care of:
  2168. @itemize @bullet
  2169. @item
  2170. @end itemize
  2171. you should not implement the
  2172. @samp{start(RootDoc)} method as it is already defined by
  2173. @samp{AbstractDoclet} so that it can care about parsing the options.
  2174. Instead, you implement method @samp{run()}, @samp{getOptions()} and
  2175. the other abstract methods to define your Doclet's behavior.
  2176. Note that all information provided by @samp{AbstractDoclet} is
  2177. evaluated lazily. That is, if your Doclet doesn't need to create an
  2178. Index page, then @samp{AbstractDoclet} will not spend resources on
  2179. creating the corresponding information.
  2180. See the API documentation for
  2181. @samp{gnu.classpath.tools.doclets.AbstractDoclet} for more details.
  2182. You should be aware that if you base your Doclet on
  2183. @samp{AbstractDoclet} then you have to bundle this and all related
  2184. classes with your Doclet, with all implications such as possible
  2185. licensing issues. Otherwise, your Doclet will only be runnable on
  2186. @samp{gjdoc} and not on other documentation systems. Also note that
  2187. @samp{AbstractDoclet} has not been extensively tested in environments
  2188. other than @samp{gjdoc}.
  2189. @comment ----------------------------------------------------------------------
  2190. @node GNU Doclet SPI, , Using AbstractDoclet, Writing Doclets
  2191. @subsection Preparing for the GNU Doclet Service Provider Interface
  2192. @cindex GNU Doclet SPI, Service Provider, SPI
  2193. In addition to the standard Doclet invocation interface described
  2194. above, @command{gjdoc} also offers a Service Provider Interface
  2195. conforming to the Java standard. Adding support for this interface to
  2196. your Doclet simplifies usage for @command{gjdoc} users because it
  2197. makes your Doclet ``discoverable''.
  2198. In order to provide the alternate interface, you have to add a class
  2199. implementing @samp{gnu.classpath.tools.gjdoc.spi.DocletSpi} to your
  2200. Doclet classes, and bundle all Doclet classes in a Jar file along with
  2201. a file named
  2202. @samp{META_INF/services/gnu.classpath.tools.gjdoc.spi.DocletSpi} which
  2203. contains the name of your class implementing DocletSpi on a single
  2204. line.
  2205. Note that if your Doclet depends on third-party classes bundled in
  2206. separate Jar files, you can link in these classes using the
  2207. @samp{Class-path:} Manifest attribute of your Doclet Jar.
  2208. Your Doclet can then be invoked in one of the following ways:
  2209. @smallexample
  2210. gjdoc -docletjar /path/to/doclet.jar
  2211. gjdoc -docletpath /path/to/doclet.jar -docletname @var{docletname}
  2212. gjdoc -docletname @var{docletname}
  2213. @end smallexample
  2214. Here, @var{docletname} is the name of your doclet as returned by
  2215. @samp{DocletSpi.getDocletName()}.
  2216. The last example will only work if your Doclet Jar is in
  2217. @command{gjdoc}'s @file{doclets} directory or if it is on the
  2218. classpath.
  2219. @comment ----------------------------------------------------------------------
  2220. @node XHTML Fragments, First Sentence Detector, Writing Doclets, Gjdoc Concepts
  2221. @section Well-formed Documentation Fragments
  2222. @cindex XHTML Fragments
  2223. For many Doclets it is advantagous if the HTML code in the comments
  2224. and HTML code passed via the command line is well-formed. For
  2225. example, HtmlDoclet outputs XHTML code, and XmlDoclet XML code, both
  2226. of which results in invalid files if the user-specified HTML isn't
  2227. wellformed.
  2228. Unfortunately, comments were never required to contain well-formed
  2229. HTML code, which means that every Doclet must deal with non-wellformed
  2230. code as well.
  2231. The @command{gjdoc} built-in Doclets deal with this problem by
  2232. ``fixing'' the HTML code - making sure that all tags are closed,
  2233. attribute values are provided and quoted, tags are properly nested,
  2234. etc.
  2235. This approach works OK in most instances, but since it uses some crude
  2236. heuristics it can sometimes produce undesirable result.
  2237. Therefore, in order to make sure that your comments are always
  2238. properly formatted, make sure they are well-formed as described in
  2239. @w{@uref{http://www.w3.org/TR/xhtml1/#h-4.1, XHTML 1.0: Documents must
  2240. be well-formed}}.
  2241. In addition, you should use meaningful tags instead of text formatting
  2242. tags to make your output look better in other output formats derived
  2243. from your HTML code. For example, you should use the <em> tag instead
  2244. of <b> if you want to emphasize text.
  2245. @comment ----------------------------------------------------------------------
  2246. @node First Sentence Detector, Adding Custom Resources, XHTML Fragments, Gjdoc Concepts
  2247. @section How Gjdoc Determines where the First Sentence Ends
  2248. @cindex First Sentence Detector
  2249. For a package, class or member summary, @command{gjdoc} only shows the
  2250. first sentence of the documentation comment in question. Because
  2251. @command{gjdoc} is not human, it is not always obvious to
  2252. @command{gjdoc} where the first sentence ends.
  2253. You might be tempted to say that the first sentence ends at the first
  2254. occurrence of a punctuation character like @samp{.} or
  2255. @samp{!}. However, consider examples like this:
  2256. @smallexample
  2257. This work, by Thomas J. Shahan et al., is about the middle ages.
  2258. @end smallexample
  2259. As you can see, it is not trivial to determine the end of the
  2260. sentence.
  2261. @command{gjdoc} gives you the choice between two approaches. By
  2262. default it uses built-in heuristics which should be compatible to
  2263. Sun's @command{javadoc} tool. This approach works quiet well in most
  2264. cases, at least for english comments.
  2265. Alternatively, you can specify option @option{-breakiterator} in which
  2266. case @command{gjdoc} will use
  2267. @samp{java.text.BreakIterator.getSentenceInstance(@var{locale}).next()}
  2268. to find the end of sentence, where @var{locale} is the locale
  2269. specified by option @samp{-locale} or the default locale if none
  2270. specified.
  2271. @emph{NOT YET IMPLEMENTED:}
  2272. @command{gjdoc} also allows you to explicitly delineate the first
  2273. sentence by putting it in a @samp{<span>} tag with the CSS class
  2274. @samp{first-sentence}. For example:
  2275. @smallexample
  2276. /**
  2277. * <span class="first-sentence">This. is. the. first.
  2278. * sentence.</span> This is the second sentence.
  2279. */
  2280. @end smallexample
  2281. Note that this will only work with @command{gjdoc}, but shouldn't hurt
  2282. when using another documentation system since the @samp{<span>} tag
  2283. usually doesn't show up in the output.
  2284. @comment ----------------------------------------------------------------------
  2285. @node Adding Custom Resources, , First Sentence Detector, Gjdoc Concepts
  2286. @section Adding Images and Other Resources
  2287. @cindex First Sentence Detector
  2288. Sometimes you want to decorate your documentation with secondary
  2289. resources such as images, SVG graphics, applets, and so on. To do so,
  2290. simply put the required files in a subdirectory 'doc-files' in the
  2291. package directory corresponding to the documentation entry you want to
  2292. decorate, and refer to it with the URL
  2293. @samp{doc-files/@var{filename}}.
  2294. For example, if you want to add an image to the description of class
  2295. @samp{baz.FooBar}, create a directory @file{doc-files} in the
  2296. directory @file{baz} containing @file{FooBar.java} and put your file,
  2297. say @file{diagram.png}, into that directory. Then, add the HTML code
  2298. like this to a comment in @file{FooBar.java}:
  2299. @smallexample
  2300. <img src="doc-files/diagram.png" width="200" height="150"
  2301. alt="Foo Diagram"/>
  2302. @end smallexample
  2303. This works because the @file{doc-files} subdirectories will be copied
  2304. to the target documentation directory every time you generate the
  2305. documentation.
  2306. Note however that by default, the @file{doc-files} directory will not
  2307. be copied deeply. In other words, if you create subdirectories under
  2308. @file{doc-files} they will not be copied and any resources located in
  2309. these subdirectories will not be accessible in your generated
  2310. documentation. You can specify option @option{-docfilessubdirs} to
  2311. remove this limitation.
  2312. Sometimes you want to use option @option{-docfilessubdirs}, but there
  2313. are certain directories which you don't want to be copied, for example
  2314. because they contain source files for the resources in
  2315. @file{doc-files}. For cases like this, use
  2316. @option{-excludedocfilessubdir} to specify directories to be omitted.
  2317. @comment ----------------------------------------------------------------------
  2318. @node I18N Issues, , Other Tools, Top
  2319. @comment node-name, next, previous, up
  2320. @chapter I18N Issues
  2321. 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.
  2322. @menu
  2323. * Language Resources:: Where resources are located
  2324. * Message Formats:: How messages are internationalized
  2325. @end menu
  2326. @comment ----------------------------------------------------------------------
  2327. @node Language Resources, Message Formats, I18N Issues, I18N Issues
  2328. @comment node-name, next, previous, up
  2329. @section Language-specific resources
  2330. 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.
  2331. 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:
  2332. @example
  2333. Command.23=A correct key password MUST be provided
  2334. @end example
  2335. 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.
  2336. For the GNU Classpath Tools described in this Guide, the @i{Resource Bundles} are files named @file{messages[_ll[_CC[_VV]]].properties} where:
  2337. @ftable @var
  2338. @item ll
  2339. Is the 2-letter code for the Language,
  2340. @item CC
  2341. Is the 2-letter code for the Region, and
  2342. @item VV
  2343. Is the 2-letter code for the Variant of the language.
  2344. @end ftable
  2345. 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)}.
  2346. 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:
  2347. @ftable @code
  2348. @item jarsigner
  2349. @file{gnu/classpath/tools/jarsigner}
  2350. @item keytool
  2351. @file{gnu/classpath/tools/keytool}
  2352. @end ftable
  2353. 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:
  2354. @enumerate
  2355. @item @code{messages.properties}
  2356. @item @code{messages_fr.properties}
  2357. @item @code{messages_fr_FR.properties}
  2358. @end enumerate
  2359. 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.
  2360. 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.
  2361. 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}.
  2362. @comment ----------------------------------------------------------------------
  2363. @node Message Formats, , Language Resources, I18N Issues
  2364. @comment node-name, next, previous, up
  2365. @section Message formats
  2366. If you open any of the @file{messages.properties} described in the previous section, you may see properties that look like so:
  2367. @example
  2368. Command.67=Issuer: @{0@}
  2369. Command.68=Serial number: @{0,number@}
  2370. Command.69=Valid from: @{0,date,full@} - @{0,time,full@}
  2371. Command.70=\ \ \ \ \ until: @{0,date,full@} - @{0,time,full@}
  2372. @end example
  2373. 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.
  2374. If you are translating a @file{messages.properties} be careful not to alter text between curly braces.
  2375. @comment ----------------------------------------------------------------------
  2376. @bye