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

References

  1. http://www.mcs.csueastbay.edu/~billard/se/cs3340/ex7/javadoctutorial.html - Contains a list of other available options. Its short, sweet and cool.
  2. http://docs.oracle.com/javase/1.4.2/docs/tooldocs/windows/javadoc.html
  3. http://www.myeclipseide.com/PNphpBB2-viewtopic-t-5191.html



Happy Programming :)
Signing Off

Ryan

No comments: