Suppose I have project directory MyProject
, under which I have src
directory with sources of the program.
I want to compile all javadocs from there. What is the simplest command to issue?
If I run
javadoc -sourcepath ./src -d ./docs
I get an error
javadoc: error - No packages or classes specified.
Can't it deduce packages from source files?
EDIT 1
This way also causes an error
...MyProject>javadoc -sourcepath ./src *.java -d ./docs Creating destination directory: "./docs\" javadoc: error - File not found: "*.java" 1 error
Javadoc is a tool which comes with JDK and it is used for generating Java code documentation in HTML format from Java source code, which requires documentation in a predefined format. Following is a simple example where the lines inside /*…. */ are Java multi-line comments.
To generate JavaDoc for all files in the same directories as your open files, click the "JavaDoc" button on the toolbar. You will then be asked where you want to save the javadoc files. Select a location and click OK. Your JavaDoc will be generated for you.
The following worked for me
javadoc -sourcepath ./src -d ./docs -subpackages .
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With