Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Can't get "Simple Example Doclet" to run -- Cannot find

843810Oct 11 2001 — edited Oct 25 2001
I am trying to run the "Simple Example Doclet" at http://java.sun.com/j2se/1.3/docs/tooldocs/javadoc/overview.html.

It appears to compile ok, but when I go to run it I get the message "javadoc: Cannot find doclet class ListClass".

Listed below is:

1. The execution command and error message
2. The version (output of javadoc -J-version)
3. The javac compile command and input and output files

All directories have been kept the same as in the example.

Any help would be appreciated.

Thanks

1. C:\jdk1.3>javadoc -doclet ListClass -classpath C:\jdk1.3\lib\tools.jar MyClass.java
javadoc: Cannot find doclet class ListClass
1 error

2. javadoc -J-version
gives
java version "1.3.1_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_01)
Java HotSpot(TM) Client VM (build 1.3.1_01, mixed mode).

3. javac -classpath C:\jdk1.3\lib\tools.jar ListClass.java
appears to give good compile ....

e. g. Input source file ListClass.java is as follows:
import com.sun.javadoc.*;

public class ListClass {
public static boolean start(RootDoc root) {
ClassDoc[] classes = root.classes();
for (int i = 0; i < classes.length; ++i) {
System.out.println(classes);
}
return true;
}
}

and.....
decompiled ListClass.class file is as follows:

// Decompiled by DJ v2.8.8.54 Copyright 2000 Atanas Neshkov Date: 10/11/2001 4:09:46 PM
// Home Page : http://members.fortunecity.com/neshkov/dj.html - Check often for new version!
// Decompiler options: packimports(3)
// Source File Name: ListClass.java

import com.sun.javadoc.RootDoc;
import java.io.PrintStream;

public class ListClass
{

public ListClass()
{
}

public static boolean start(RootDoc rootdoc)
{
com.sun.javadoc.ClassDoc aclassdoc[] = rootdoc.classes();
for(int i = 0; i < aclassdoc.length; i++)
System.out.println(aclassdoc[i]);

return true;
}
}
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 22 2001
Added on Oct 11 2001
3 comments
295 views