javadoc problems

When I run javadoc on my source files I get 3 files which are basically empty (except for the standard titles that javadoc generates) - AllNames.html, packages.html and tree.html. I don't get any of my classes documented
My source file <MyClass.java>  follows:

package TestDoc;

/**
* Test the javadoc utility
*
* @version %I%, %G%
*/
class MyClass
{
      /**
      * This is some class to test
      * @param y      The Parameter
      */
      public void MyMethod(int y)
      {
            int x = y;
      }
}

This file resides in directory TestDoc and I am running the following line from that directory:
javadoc *.java

Thanks
RHonigAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

froderikCommented:
Sounds strange, does javadoc give you any valuable error message?
0
jpk041897Commented:
Try it as follows:



    package TestDoc;

    /**
    * Test the javadoc utility
    *
    * @version %I%, %G%
    * <;pre>;
    *    MyClass  cls  = new MyClass();
    *    void myMethod(int show);
    * <;/pre>;


    */
    class MyClass
    {
    /**
    * This is some class to test
    * @param y The Parameter
    *
    * y represents the value to assign to x.
    * @see MyClass#1
    */
    public void MyMethod(int y)
    {
    int x = y;
    }
    }


And since you are using a package, you will also need to use the CLASSPATH option in your call to javadoc.

CLASSPATH  

Used to provide the system a path to user-defined classes. Directories are separated by semi-colons, for example,  


.;C:\users\dac\classes;C:\tools\java\classes

0
RHonigAuthor Commented:
I cut n pasted your (jpk's) suggestion (I got rid of the package statement to remove that factor for now) and ran javadoc again but got the same results.
The output I get when running javadoc is:
C:\Java\TestDoc>javadoc *.java
Generating package.html
Generating index
Generating tree

but none of these output files contain any reference to my classes.

0
OWASP Proactive Controls

Learn the most important control and control categories that every architect and developer should include in their projects.

froderikCommented:
I just tried it out. For me it works just fine to run javadoc on packaged files with or without CLASSPATH. The documentation for different classes are correctly generated. I am using JDK 1.1.5 on Windows NT 4.0. Perhaps the earlier versions of JDK had a less useful behavior? Which version do you use? If you are using an old version an update may help. (If you are lucky...) If you don't wanna update you should follow jpk's suggestion and take a closer look at your CLASSPATH variable.

Hope this help.
0
RHonigAuthor Commented:
I am using JDK 1.1.5, NT 4.0 too.I'll try playing around with the CLASSPATH a bit. Another possible factor is, I installed Visual Cafe 2.5 after installing JDK115, but I'm only using Cafe for editing, it may however, have messed something up.
0
fontaineCommented:
This receipt should work. In a ".bat" file, let say "doc.bat", write the following:

SET CLASSPATH=.;c:\jdk1.1.5\lib\classes.zip
javadoc TestDoc

Put it in a directory. A sub-directory of it should be called "TestDoc" (the name of the package)
and should contain the source of the classes of that package. Running doc.bat should generate the doc.


0
fontaineCommented:
Hello RHonig! Did my answer solve your problem, finally?
0
RHonigAuthor Commented:
Sorry fontaine, that wasn't it.
I found out that my problem was that the class was not declared as public.
As soon as I declared the class public I got all the methods and members I was expecting
0
evijayCommented:
Create the file MyClass.java in a directory TestDoc
Set the classpath to the directory parent of TestDoc
Give the javadoc with the following options in the parent directory of TestDoc

javadoc -private TestDoc\*.java

for more options on javadoc type  "javadoc - help" on command line

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
RHonigAuthor Commented:
That was it. I should read the documentation more carefully. I guess this is a case of "RTFM...Read the F... Manual", but at least you got 100 points for your trouble.Thanks for the pointer.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.