This discussion is archived
2 Replies Latest reply: Aug 21, 2008 2:45 AM by 843793 RSS

javadoc  annotation processing

843793 Newbie
Currently Being Moderated
Hi,
I made a eclipse wizard and from inside a java file, i am running a "javadoc" command to create documentation from java source files. Using following command.


Process docProcess=runtime.exec("javadoc -docletpath \""+getClassPath("com.sun.javadoc.Doc")+"\" -classpath \"" + cp + "\" -d "+rootPath+" - sourcepath "+
containerPath+"/"+packageName+"/*.java");

where

rootpath="root dir location"
cp="class path for jaxrpc.jar, axis-1.4.jar and classfiles for java source ".
containerPath="root dir location"
packageName="name of package"

Command is working perfect from dos prompt.But it is not working when i am running it from runtime.exec() method.
  • 1. Re: javadoc  annotation processing
    843793 Newbie
    Currently Being Moderated
    You can run Javadoc from within another javaprogram. You do not have to call up the operatingsystem to run javadoc.exe for you.
    Example from the javadoc faq [http://java.sun.com/j2se/javadoc/faq/index.html#runfromwithin] :
    your_method() {
        // your code
        String[] javadocargs = { "-d", "docs", 
                                 "-sourcepath", "/home/user/src",
                                 "java.applet" }; 
        com.sun.tools.javadoc.Main.execute(javadocargs); 
        // your code
    }
    - Roy
  • 2. Re: javadoc  annotation processing
    843793 Newbie
    Currently Being Moderated
    Hello Roy,

    Thanks to guide me. I use way as you suggested, now it is working properly.

    Thanks&Regards
    Prakash soni