I'm having a go at creating a custom Javadoc generator using Doclet
, but I'm running into some issues.
I'm following the official documentation and initially had trouble with including the tools.jar
file in my project, but I managed to fix this.
My issue now is that after running this command...
javadoc -doclet ListClass -docletpath . MyClass.java
...I am getting the message...
javadoc: error - Cannot find doclet class ListClass
As I said, I've mostly been following the tutorials from the official documentation, but here is my code for reference.
ListClass.java
:
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[i]);
}
return true;
}
}
And MyClass.java
:
/**
* Documentation for my class
*/
public class MyClass {
public static void main(String[] args) {
}
/**
* Documentation for my static void method
*
* @param param This is the parameter it takes in
*/
public static void myStaticVoidMethod(String param) {
}
}
So what I am asking is why I am getting the error I posted above. If someone was able to provide a more comprehensive guide of how Doclet
works that would be great as well.
Note: I'm using IntelliJ IDE for my project. Here is my directory structure:
- .idea
- ...
- out
- ...
- src
- ListClass.java
- MyClass.java
- JavadocGenerator.iml