1 Reply Latest reply on Apr 8, 2013 5:50 PM by thomas_behr

    How to run doclet for many classes from the doclet itself

    987437
      I've a doclet that I need to run it for many classes/packages and I need to run it from the doclet itself.

      public static void main (String[] args) throws IOException{
      com.sun.tools.javadoc.Main.execute(new String[] { "-doclet", "package.NewDoc", "-docletpath", ".",
      "-private", "<path>/Example.java"});
      }
      I tried running it for a single class as above and it runs fine but for multiple files, it fails. Is there a way to input many files or a package to the above line. Tried replacing the last argument to <path>/*.java but did not work!
        • 1. Re: How to run doclet for many classes from the doclet itself
          thomas_behr
          You need to explicitly specify each and every file you want to document as an additional element in that array:
          public static void main (String[] args) throws IOException {
            com.sun.tools.javadoc.Main.execute(new String[] {
            "-doclet",
            "package.NewDoc",
            "-docletpath",
            ".",
            "-private",
            "<path1>/File1.java",
            "<path2>/File2.java",
            "<path3>/File3.java",
            "<path4>/File4.java",
            ...
            });
          }
          I realize I'm late to the party, but hopefully the answer will help somebody that struggles with the same problem in the future.