JDK-4935349 : Get error message "invalid flag: -d" when add -doclet and -docletpath options
  • Type: Bug
  • Component: tools
  • Sub-Component: javadoc(tool)
  • Affected Version: 1.4.2
  • Priority: P3
  • Status: Closed
  • Resolution: Not an Issue
  • OS: windows_nt
  • CPU: x86
  • Submitted: 2003-10-09
  • Updated: 2014-05-05
  • Resolved: 2003-10-16
Description

Name: rmT116609			Date: 10/09/2003


FULL PRODUCT VERSION :
java version "1.4.2_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_01-b06)
Java HotSpot(TM) Client VM (build 1.4.2_01-b06, mixed mode)

FULL OS VERSION :
Windows NT Version 4.0

A DESCRIPTION OF THE PROBLEM :
Running javadoc without a custom doclet works. I set the destination path for the javadoc output with the "-d" parameter. But when adding the parameters "-doclet" and "-docletpath" to the javadoc call, the following error occurs:

javadoc: invalid flag: -d
usage: javadoc [options] [packagenames] [sourcefiles] [classnames] [@files]
-overview <file>          Read overview documentation from HTML file
-public                   Show only public classes and members
-protected                Show protected/public classes and members (default)
-package                  Show package/protected/public classes and members
-private                  Show all classes and members
-help                     Display command line options and exit
-doclet <class>           Generate output via alternate doclet
-docletpath <path>        Specify where to find doclet class files
-sourcepath <pathlist>    Specify where to find source files
-classpath <pathlist>     Specify where to find user class files
-exclude <pkglist>        Specify a list of packages to exclude
-subpackages <subpkglist> Specify subpackages to recursively load
-breakiterator            Compute 1st sentence with BreakIterator
-bootclasspath <pathlist> Override location of class files loaded
                          by the bootstrap class loader
-source <release>         Provide source compatibility with specified release
-extdirs <dirlist>        Override location of installed extensions
-verbose                  Output messages about what Javadoc is doing
-locale <name>            Locale to be used, e.g. en_US or en_US_WIN
-encoding <name>          Source file encoding name
-J<flag>                  Pass <flag> directly to the runtime system

1 error

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
call javadoc without "-doclet"/"-docletpath" and other parameters like "-d", "-classpath", "-sourcepath" so that it works without errors. Then add the valid parameters "-doclet" and "-docletpath" to the javadoc call and run it.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Call of javadoc without errors (only Doclet specific erros if the Doclet has errors).
ACTUAL -
javadoc quits with an error message ("invalid flag: -d")

ERROR MESSAGES/STACK TRACES THAT OCCUR :
javadoc: invalid flag: -d
usage: javadoc [options] [packagenames] [sourcefiles] [classnames] [@files]
-overview <file>          Read overview documentation from HTML file
-public                   Show only public classes and members
-protected                Show protected/public classes and members (default)
-package                  Show package/protected/public classes and members
-private                  Show all classes and members
-help                     Display command line options and exit
-doclet <class>           Generate output via alternate doclet
-docletpath <path>        Specify where to find doclet class files
-sourcepath <pathlist>    Specify where to find source files
-classpath <pathlist>     Specify where to find user class files
-exclude <pkglist>        Specify a list of packages to exclude
-subpackages <subpkglist> Specify subpackages to recursively load
-breakiterator            Compute 1st sentence with BreakIterator
-bootclasspath <pathlist> Override location of class files loaded
                          by the bootstrap class loader
-source <release>         Provide source compatibility with specified release
-extdirs <dirlist>        Override location of installed extensions
-verbose                  Output messages about what Javadoc is doing
-locale <name>            Locale to be used, e.g. en_US or en_US_WIN
-encoding <name>          Source file encoding name
-J<flag>                  Pass <flag> directly to the runtime system

1 error

REPRODUCIBILITY :
This bug can be reproduced always.
(Incident Review ID: 214962) 
======================================================================

Comments
EVALUATION Clarified the synopsis. Asked for the exact command executed. ###@###.### 2003-10-09 The submitter answered this question himself, noting that -d is a standard doclet option (not a javadoc option), so is not available to custom doclets. > In another thread i read, that -d has to be supported by the custom doclet. > but my custom doclet does not read any parameters. and i thought that -d is a > standard parameter that is used by the javadoc. but it makes kind of sense, > becuase my first test doclet prints System.out's ... therefore a -d parameter > wouldn't make much sense for such a doclet. > > http://forum.java.sun.com/thread.jsp?forum=41&thread=452764&tstart=0&trange=30 Closing out as not a bug. ###@###.### 2003-10-15
15-10-2003