How to generate Javadoc from command line

Can anybody show me how to generate Javadoc from command line?

My project contains the package com.test and I want to put the generated documentation in files located in a specific folder like this: C:/javadoc/test.


Solution 1:

You can refer the javadoc 8 documentation

I think what you are looking at is something like this:

javadoc -d C:\javadoc\test com.test

Solution 2:

Oracle provides some simple examples:

http://docs.oracle.com/javase/8/docs/technotes/tools/windows/javadoc.html#CHDJBGFC

Assuming you are in ~/ and the java source tree is in ./saxon_source/net and you want to recurse through the whole source tree net is both a directory and the top package name.

mkdir saxon_docs
javadoc -d saxon_docs -sourcepath saxon_source -subpackages net