Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Beginning Java and the fly likes Trouble with javadocs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Trouble with javadocs" Watch "Trouble with javadocs" New topic

Trouble with javadocs

Tony Jackson
Ranch Hand

Joined: Feb 23, 2001
Posts: 45
I'm having trouble learning how to use javadoc, perhaps someone can help clarify.
I am using Visual Cafe (no hisses please!) and I have three classes in the same package:
class a.b.c.D
class a.b.c.E
class a.b.c.F
and I would like to create javadocs for all three of these classes at once.
My three source files,, and are all in the folder C:\JavaStuff
When I compile the three source files using the IDE, it automatically creates the folder:
and in this folder is the compiled class files (D.class, E.class, F.class)
I am trying to invoke javadoc from the command line (there is probably a way to do it from the IDE as well) and from the C:\JavaStuff folder I have tried:
and each one works but it overwrites the others. What I want is one command to create javadocs for all three files at once, and it seems like this should be possible since I have put them all in the same package.
I tried specifying the package the way you would with jar:
javadoc a\b\c\* and that doesn't work since it tries to package the .class files, and not the source code. I tried copying the source code into the C:\a\b\c folder and the above command still didn't work since it found all files including the .class files. I tried it without the asterisk and that didn't work either. This has me wondering if my source files should be in the a\b\c folder instead of at the top level? Maybe if I were using the sun SDK compiler I would have been required to do this and now I would have no trouble creating the javadocs? There is a key concept here I am missing.
Marilyn de Queiroz

Joined: Jul 22, 2000
Posts: 9059
You've seen this page, right?

"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Tony Jackson
Ranch Hand

Joined: Feb 23, 2001
Posts: 45
Hi Marilyn,
I was using the Java in a Nutshell as my guide, but I'll read through the official javadoc guide. It is quite thorough and I was hoping to get a quick answer as to what I was doing wrong instead of having to invest 30-60 min reading through it.
Also, the documentation is confusing to me. For example, it says the syntax is:
javadoc [ options ] [ packagenames ] [ sourcefiles ] [ @files ]
and from what I can tell all the options begin with a hyphen (dash) character such as -SOURCEPATH. But when I look at the "Real-World Example" listed, it seems to include many options but no packagenames or sourcefiles, which is confusing to me.
I agree. Here's the link:
subject: Trouble with javadocs
It's not a secret anymore!