Thursday, March 22, 2012

Generate Javadoc Through Command Line

Here's a quick tip on generating Javadoc HTML files for your Java classes via command line.

javadoc  < MySourceFileName > .java -d <Destination Directory>

You need to make use of the 'javadoc' command.
You can specify multiple files separated by a white space or you can simply specify a directory name containing all your source files.

javadoc -sourcepath  < Source Directory >  -d  < Destination Directory>

Although I havent worked with eclipse, I believe it has an option where you can specify the javadoc command and then you would be able to easily generate documents via some menu option. Just FYI, if you work on windows, the javadoc command is located in the same directory as the java.exe command.

For more help and options on this command, check out the references


  1. - Contains a list of other available options. Its short, sweet and cool.

Happy Programming :)
Signing Off


No comments: