tags:

views:

187

answers:

1

I have a javadoc doclet that requires an additional jar file to be on the doclet's classpath. To run the doclet from the command line, I do something like this:

java com.sun.tools.javadoc.Main -doclet myPackage.myDoclet -docletpath /path/to/doclet/classes

When I run that, it finds the doclet on the path and executes it, but the doclet uses an additional jar that needs to be on the classpath, so eventually, I get a ClassNotFoundException.

When I change the command line to this:

java com.sun.tools.javadoc.Main -doclet myPackage.myDoclet -docletpath /path/to/doclet/classes:/path/to/some.jar

It no longer finds the doclet (javadoc: error - Cannot find doclet class com.adventact.si.workflow.javadoc.ListClass). So, it appears that the doclet argument does not accept a list of paths, but only a single one.

(note that these command lines aren't complete - I'm not showing how I set the classpath, as it's irrelevant to the docletpath problem, and is really spammy.)

How do you workaround this?

+2  A: 

The http://java.sun.com/javase/6/docs/technotes/tools/windows/javadoc.html#docletpath">documentation for Javadoc says that a list of paths is allowed. Ensure that you're using the correct path-separating character, either ';' or ':' depending on whether you're on Windows or UNIX (respectively).

NOTE: If you're truly using java and not javadoc to execute your doclet, then check the implementation of your class. -docletpath is not a standard option to the java executable, so must be being interpreted by your doclet implementation. However, if you're using javadoc then the documentation I pointed to above says:

If classpathlist contains multiple paths or jar files, they should be separated with a colon (:) on Solaris and a semi-colon (;) on Windows.

Eddie
Doh.... this bites me everytime.... : vs. ;. Thanks.
Jared
Editted OP to more completely reflect the fact that I am indeed calling java and not javadoc.
Jared