• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Javadoc on Jar

 
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Yoo-Jin Lee
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

You still don't have to extract everything.
You could use the -t option of jar
to get a list table of contents for archive
jar -t myJarFileName.jar
Is this what you are looking for?
regds.
- satya
 
Cindy Glass
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, that does get you a table of contents, but not the JavaDoc for those classes.
 
    Bookmark Topic Watch Topic
  • New Topic