Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to compile javadoc from sources in simplest way?

Tags:

java

javadoc

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 
like image 326
Suzan Cioc Avatar asked Apr 03 '12 12:04

Suzan Cioc


People also ask

What is Javadoc give example?

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.

How do I save a Javadoc?

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.


1 Answers

The following worked for me

javadoc -sourcepath ./src -d ./docs -subpackages . 
like image 66
Suzan Cioc Avatar answered Oct 09 '22 09:10

Suzan Cioc