I’m writing a Java app that will let me compile a Java project based solely on it’s file structure so that I can write code and compile without an IDE. The problem that I’m currently having is that I would like to automatically generate the javadoc while I’m compiling, though while Java 6 supplies a JavaCompiler object to work with, I can’t find a way to use the javadoc command.
How can I generate the javadoc html for my projects using Java code?
Just in case you weren’t aware both Apache Ant and Apache Maven are tools that exist to accomplish a similar goal to what you are writing (compiling without an IDE).
Both of them have built in support for generating javadoc. Ant syntax looks like this:
If you really want to generate it on your own you want to use the Doclet API