Bug 34681 - javah task fails with java.lang.NoClassDefFoundError
Summary: javah task fails with java.lang.NoClassDefFoundError
Status: RESOLVED FIXED
Alias: None
Product: Ant
Classification: Unclassified
Component: Optional Tasks (show other bugs)
Version: 1.6.3
Hardware: Sun Solaris
: P2 major (vote)
Target Milestone: 1.6.4
Assignee: Ant Notifications List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-29 20:12 UTC by Maury Feskanich
Modified: 2008-02-22 12:18 UTC (History)
2 users (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maury Feskanich 2005-04-29 20:12:14 UTC
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.
Comment 1 Matt Benson 2005-04-29 20:27:37 UTC
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?
Comment 2 Stefan Bodewig 2005-05-02 17:04:07 UTC
Fixed in CVS.

As a workaround you could add tools.jar to your CLASSPATH.