Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


javadoc integration with jdk docs

Posted on 1997-05-08
Medium Priority
Last Modified: 2013-11-23
This sounds simple, but I can't seem to do it. What I would like to do is have javadoc integrate my generated documentation with the jdk files. In other words, when javadoc generates tree.html, for instance, how can it generate links under "Class Hierarchy" to java.lang.Object and all other classes within the language? Is there a way to  append and proliferate these links when my classes extend the stuff in jdk? I tried copying the jdk doc html files to the same directory as my javadoc output, but javadoc did not like this. javadoc preferred to overwrite exising files.

Has anyone found a way to do this or something similar? I need an automated solution; hopefully something for a makefile.

FWIW, I'm using jdk1.1.1 under Solaris.
Question by:roy020697
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 3
  • 3
  • +1

Expert Comment

ID: 1220268
Here is an example:

 * A class representing a window on the screen.
 * For example:
 * <;pre>;
 *    Window win = new Window(parent);
 * <;/pre>;
 * @see            awt.BaseWindow
 * @see            awt.Button
 * @version        1.2 12 Dec 1994
 * @author         Sami Shaio
class Window extends BaseWindow {
For this to actualy work though, you need to make sure that the java source files are in the class path used by javadoc. You must therfore override the default classpath with:

javadoc -classpath .;/usr/jdk1.1/src

I'm not sure this answer actually addresses your question so I'm posting as a comment.

Author Comment

ID: 1220269
Correct; it does not address my question :-)
Thanks for the comment, though.

Here is what I am looking for:
PLease look (in your environment) at the file $JDK_DIR/docs/api/packages.html with a browser. Scroll to the bottom where it says "Other Packages". In JDK1.1.1 this lists stuff from Sun (package,, sun.util). I would like my packages there, too!

Now, select the link to package sun.utils. Now select the class EventObject. Notice how the heirarchy java.lang.object and java.util.EventObject are hyperlinks? That is also what I want!

I have my classpath initialized properly so that I can compile. I have all my classes included in a named package "com.sterlingdi". Assuming my current working dir is /cwd my java source files are in the directory /cwd/com/sterlingdi. I have a docs directory /cwd/docs. I even copied all the $JDK_DIR/docs/api/* files to /cwd/docs and made them writable so javadoc could replace certain files like packages.html, tree.html, etc.
I must be doing something wrong... doen't anyone else have their javadoc output integrated with the java language API docs?

Author Comment

ID: 1220270
Looks like the price is too small. Tell ya what I'll do; I'll raise the stakes a bit, but to collect I need a workable solution. The answer "you can't do that!" might be true, but it will not get you the points. If the answer I seek can't be done with the tools supplied by Sun, then there must be a sed/awk hacker out there who could rise to the challenge!
Build and deliver software with DevOps

A digital transformation requires faster time to market, shorter software development lifecycles, and the ability to adapt rapidly to changing customer demands. DevOps provides the solution.


Author Comment

ID: 1220271
Adjusted points to 300

Expert Comment

ID: 1220272
I'm not sure if this will work, so it's a comment.

Have you tried putting your src files into the jdk1.1.1/src/ directory and then javadoc-ing them all.  ie completely regenerate all the java.* files at the same time.

As far as I can see this should work.

Expert Comment

ID: 1220273

I have two suggestions and one comment.

1.- One way (unsatidfactory) that you can achieve your goal is to use embeded HTML code inside your documentation sections of code (like the Sun source uses). I won't go deeper into this since its really a waste of time based on the next suggestion.

2.- Take a look at:

and download Doc++

For a simple sample page generated by Doc++ see:

If this does solve your problem, then please bring down the points (to my knoledge none of the experts here is actualy making anu money) and this answer is certanly not worth 300 points! If this solves your problems, use up some of those points for another question.

Author Comment

ID: 1220274

I'm not sure what you were driving at with embedded HTML in my doc sections of code... the parts of my html that I want hyperlinks to are not extraced (directly) from my code; it is in the headers generated by javadoc (see original post & my first comment). Doc++ looks like a good javadoc rip-off which generates consistant looking documentation for java and C++, but it still won't put the hyperlinks where I'd like.

BTW, it is a lot of points for a simple question, but I needed the answer quickly, and I have points to burn :-)

It was too easy! I did not notice the file that came with the Solaris install in $JDK_HOME. I unzipped this file in the top of my package hierarchy, moved a couple of directories around, ran javadoc, and it ran out of memory on a Sun Ultra with 128MB of RAM! I added -J-mx64m -J-ms64m to the javadoc command line and five minutes later thousands of html files were produced. The links were right where I needed them! Maybe you should only get credit for alerting me to the fact that there is a bunch of java source files bundled in with the JDK, but I would have spun my wheels for days (weeks?) without that clue.

On the other hand, jpk did have his original answer which included CLASSPATH pointing to a directory which could contain java API source code. My installation had no such directory... just a file in the jdk1.1.1 dir.

You should both split the prize, but since the points are only worth bragging rights I'll award them to the first one of you two who posts an answer. It may not be fair, but it is not worth the effort to reduce these points, post a fake question, wait for the  right person to answer, etc...

Expert Comment

ID: 1220275
I have brag points to spare :-)

rkin005 was closer to the mark so they are his, Or perhaps, if rkin005 agrees, since neither of us actualy answered your question, we should just let it stand  and let you recover your points.

Expert Comment

ID: 1220276
I had the same problem before and I fortunately solved it.
It was the previous year and I don't remember it very well
but I have a starting point for you...
Something sure is that the processus should be made in
two steps. In one step you specify the name of your package
as an argument to the javadoc command and in the second step
you give the name of the source files as arguments.
It should be something like:
javadoc -sourcepath source_path -d destination_path package_name
javadoc -sourcepath source_path -d destination_path *.java
I don't remember which one should be made before which.
I beleive that javadoc ... *.java is the command that should be
made first (but I'm not sure).
Ah, another thing... one of the problem might be that the second command (whatever it is) will erase some of the html files
you want to keep (index.html and/or tree.html and/or packages.html)
The solution is either to move those files to another directory
and then moving them back when you have finished or you can use the -noindex or -notree options when using javadoc.

With this informations you should be able to find out the exact
way to do it and make a shell-script that automate that.

Hope this helps!


Author Comment

ID: 1220277
If you had read any of the threads in this question (or at least my last comment) you would realize that this question has already been answered and I am waiting for rkin005 to claim his points.

Your answer is vague and incorrect. It can be accomplished in one step. Thanks for trying, but please read the question *and* the responses before posting; it prevents you from sounding uninformed.

Expert Comment

ID: 1220278
OK, how do I claim my points - all of them !!

no just kidding.  I agree it was a bit easy once you knew how.  How about we each get 50, and roy keeps the rest.
Alternatively I'll take them all if this is too much bother ;)

If you could (fully) answer my question in the Java area - ie get an RMI example to work in Netscape Communicator that would be equivalent.

anyway, whatever I'm not that bothered either.



Author Comment

ID: 1220279

I am not able to decrease the points awarded; I can only increase them :-/  Good news for you; jpk doesn't want them -- (s)he feels that your answer was closer to the mark.

To collect your points, instead of posting a comment by clicking the Comment radial button, click on the Anser radial button.  Then add some text to the text area (your answer) and press the Submit button. This locks the question until I grade your answer. When I give you a passing grade you will get an e-mail notification and the points are added to  your account.

As for your RMI question, I'll check it out and post something constructive if I can help.

Thanks again for your time.



Author Comment

ID: 1220280

I could not find your question on RMI (or any question from you) posted in the Java area... when was it posted?

Accepted Solution

rkin005 earned 600 total points
ID: 1220281

my question was,

  5/14/97 230 simple RMI error in Communicator

- Rory

Author Comment

ID: 1220282
Thanks for the answer, Rory.

Yes, I sawyour question after I posted my comment (sorry about that!).
I've been trying to get the RMI demo to work for me, too. I'va had marginal success after several other interruptions this afternoon. I'll have another go at it tomorrow.


Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Suggested Courses

664 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question