Sonntag, 26. August 2012

Using Sun DocCheck for Java

Today I tried to get the Sun DocCheck tool up and running on my Macbook. Yes, I know that Checkstyle covers even more than this tool. But I needed to have a look at it because of research for my doctoral thesis. I would like to describe my trip through the javadoc-valley-of-tears in this post. Maybe it is useful for some of you out there :).

  1. Download the doccheck.jar here. The links on the official Oracle Homepage don't seem to work.
  2. DocCheck requires the class com.sun.tools.doccheck.HtmlWriter. This class is no longer included in modern JDKs. So I downloaded the Java 1.2 SDK for Windows, installed it on my Windows machine and took the tools.jar from this installation. Save this JAR in the same directory as doccheck.jar.
  3. Put the tools.jar into the classpath: export CLASSPATH=tools.jar
  4. Call the javadoc-command with the doccheck doclet:
javadoc -doclet com.sun.tools.doclets.doccheck.DocCheck -docletpath doccheck.jar -sourcepath <PATH_TO_YOUR_CODE> -d <OUTPUT_DIR> -subpackages <YOUR_TOPLEVEL_PACKAGE>

Keine Kommentare:

Kommentar veröffentlichen