PistolPete
PistolPete

Reputation: 784

Javadoc: error - Cannot find doclet class

I'm trying to run Javadoc with a custom doclet from windows command line:

javadoc -classpath C:\path\to\build\dir -sourcepath C:\path\to\src\dir -doclet somePackageName.customDocletClassFileName anotherPackageName

"anotherPackageName" is the package directly under given sourcepath for which I want to produce documentation.

When I execute it like this I get the error:

javadoc: error - Cannot find doclet class somePackageName.customDocletClassFileName 

It seems like there is something wrong with the -classpath flag, any ideas?

If I substitute

-doclet somePackageName.customDocletClassFileName

to

-docletpath somePackageName

it works better (although I cannot really verify the output since I have not added the testng jar to the classpath and then there's a lot of other issues).

Upvotes: 7

Views: 5558

Answers (1)

PistolPete
PistolPete

Reputation: 784

SOLUTION:

-classpath is not used for finding doclets, instead -docletpath should be used, i.e:

javadoc -classpath C:\path\to\build\dir -docletpath C:\path\to\build\dir -sourcepath C:\path\to\src\dir -doclet somePackageName.customDocletClassFileName anotherPackageName

(Thanks to a colleague)

Upvotes: 8

Related Questions