Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How do I run Javadoc from within a Java application?

application Java Javadoc run
0
Posted

How do I run Javadoc from within a Java application?

0

For Javadoc 1.2 and later: your_method() { // your code String[] javadocargs = { “-sourcepath”, “/home/atuld/JDK/1.3/src/share/classes”, “-nodeprecated”, “-d”, “applet”, “java.applet” }; com.sun.tools.javadoc.Main.main(javadocargs); // your code } The disadvantages of this are: (1) It can only be called once per run (since static information is stored) – use java.lang.Runtime.exec(“javadoc …”) if more than one call is needed. (2) Exit code is not returned, so you can’t tell if it failed. (3) Can’t set where output goes or what the command is called. For Javadoc 1.1.x, drop com (above) and instead use sun.tools.javadoc.Main.main(javadocargs);. In the next major verion of Javadoc after 1.3 (probably to be called 1.4), we will be releasing a programmable interface for this in the form of an execute method. See Request 4113483.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123