Hi, Can anyone enlighten me on how to generate javadoc comments on jar files by: javadoc .... I can do it for regular files but when I set the sourcepath to the jar file that contains all my classes I get errors. Thanks in advance. Yoo-Jin.
I don't believe that you CAN create JavaDoc out of a Jar file.
JavaDoc Options As parameters to JavaDoc, you can specify a single source file, multiple source files, or package names. If you specify a package name, you will get documentation for all the classes in the package, including a class hierarchy and an index. Javadoc searches your CLASSPATH for the specified files. To include directories that are not in your classpath, you can specify -classpath parameter to Javadoc to add those. -classpath (specify the classpath to use) -sourcepath (specify where the source files (.java) are, not the .class files.) -version (If a version tag is found, it will be included in the documentation) -author (If an author tag is found, it will be included in the documentation -noindex (do not generate index) -notree (do not generate tree information) -d (specify the directory for the output files) -verbose (produce a detailed listing from the JavaDoc compilation)
There is no mention in this of a source jar being an input. However, there is nothing stopping you from decompressing the jar into a temp directory, running the utility against the source files and then deleting the temp directory. Any unzip or File Librarian type of utility will unzip them... I peek at one or two all the time.
"JavaRanch, where the deer and the Certified play" - David O'Meara
posted 19 years ago
Cindy, Thanks for your reply. I was hoping I wouldn't have to extract everything, but I guess really it's no big deal. cheerios, Yoo-Jin.