Let's say you have the following directory structure in which you want to generate javadocs on file1.java and file2.java (package com.test), with javadocs placed in C:\javadoc\test :
C:\ | +--javadoc\ | | | +--test\ | +--projects\ | +--com\ | +--test\ | +--file1.java +--file2.java
In the command terminal, navigate to the root of your package: C:\projects . If you just want to generate standard javadocs in all java files inside the project, run the following command (for several packages, separate the package names with spaces):
C:\projects> javadoc -d [path to javadoc destination directory] [package name] C:\projects> javadoc -d C:\javadoc\test com.test
If you want to run javadocs from another place, you need to specify the path to the source file. For example, if you need to run javadocs in C:\ , you should change the command as such:
C:\> javadoc -d [path to javadoc destination directory] -sourcepath [path to package directory] [package name] C:\> javadoc -d C:\javadoc\test -sourcepath C:\projects com.test
If you want to run javadocs only for selected .java files, add the original file names separated by spaces (you can use an asterisk (*) for a wildcard). Do not forget to specify the path to the files:
C:\> javadoc -d [path to javadoc destination directory] [source filenames] C:\> javadoc -d C:\javadoc\test C:\projects\com\test\file1.java
More information / scenarios can be found here .
shimizu Apr 26 '15 at 13:12 2015-04-26 13:12
source share