The javah task fails with the following message: [javah] Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/tools/javah/oldjavah/Main The following build file will reproduce the error: <?xml version="1.0"?> <project name="javah.bug" default="produce.bug" basedir="."> <target name="produce.bug"> <javah class="doesntmatter" /> </target> </project> I am running Solaris 9 on a Sun Ultra 60, using JDK 1.5.0. I posted a question about this to user@ant.apache.org, and Antoine Levy-Lambert responded with: "The class which is trying to use com.sun.tools.javah.oldjavah.Main is src/main/org/apache/tools/ant/taskdefs/optional/javah/SunJavah.java http://cvs.apache.org/viewcvs.cgi/ant/src/main/org/apache/tools/ant/taskdefs/optional/javah/SunJavah.java I guess the problem is that the changes done in revision 1.2 and maybe 1.3 too should have been merged to the ant 1.6.3 branch, but were not." This problem makes Ant 1.6.3 unusable for any project that requires javah.
Yeah, this is probably the use-case that made me commit the 1.2 changes. Since I didn't merge it, I'll take part of the blame here... now what?
Fixed in CVS. As a workaround you could add tools.jar to your CLASSPATH.