Solved

javadoc integration with jdk docs

Posted on 1997-05-08
15
442 Views
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.
0
Comment
Question by:roy020697
  • 8
  • 3
  • 3
  • +1
15 Comments
 
LVL 6

Expert Comment

by:jpk041897
ID: 1220268
Here is an example:

/**
 * A class representing a window on the screen.
 * For example:
 * <;pre>;
 *    Window win = new Window(parent);
 *    win.show();
 * <;/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.
0
 
LVL 1

Author Comment

by:roy020697
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.tools.debug, sun.io, 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?
0
 
LVL 1

Author Comment

by:roy020697
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!
0
 
LVL 1

Author Comment

by:roy020697
ID: 1220271
Adjusted points to 300
0
 

Expert Comment

by:rkin005
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.
0
 
LVL 6

Expert Comment

by:jpk041897
ID: 1220273
Well,

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:

http://www.oasis.leo.org/java/development/documenting/00-index.html

and download Doc++

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

http://www.oasis.leo.org/cgi-bin/leo-peek/java/_/development/documenting/docxxdoc.zip/_/HIER.html


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.
0
 
LVL 1

Author Comment

by:roy020697
ID: 1220274
jpk-

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 :-)

rkin005-
It was too easy! I did not notice the src.zip 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 src.zip 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...
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 6

Expert Comment

by:jpk041897
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.
0
 

Expert Comment

by:eubnima
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!

0
 
LVL 1

Author Comment

by:roy020697
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.
0
 

Expert Comment

by:rkin005
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.

regards,

Rory
rkin005@abs-student.auckland.ac.nz
 
0
 
LVL 1

Author Comment

by:roy020697
ID: 1220279
Rory-

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.

-Roy

0
 
LVL 1

Author Comment

by:roy020697
ID: 1220280
Rory-

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

Accepted Solution

by:
rkin005 earned 300 total points
ID: 1220281
Roy,

my question was,

  5/14/97 230 simple RMI error in Communicator

http://www.experts-exchange.com/Q.8630002388


thanks,
 
- Rory
0
 
LVL 1

Author Comment

by:roy020697
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.

0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

762 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now