For the record, attached is the patch that makes
SunJavah work for me:
-Matt
--- Matt Benson <[EMAIL PROTECTED]> wrote:
> Am I the only one for whom this test is failing (in
> HEAD)? I am running on W2K w/ various java
> versions;
> what I am seeing is that, now that the Java
> invocation
> is forked, tools.jar is no longer on the classpath
> and
> I get a CNFE... what do you think, Stefan?
>
> -Matt
>
>
>
> __________________________________
> Do you Yahoo!?
> All your favorites on one personal page – Try My
> Yahoo!
> http://my.yahoo.com
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>
>
__________________________________
Do you Yahoo!?
Yahoo! Mail - You care about security. So do we.
http://promotions.yahoo.com/new_mail
Index: src/main/org/apache/tools/ant/taskdefs/optional/javah/SunJavah.java
===================================================================
RCS file:
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/javah/SunJavah.java,v
retrieving revision 1.1
diff -u -r1.1 SunJavah.java
--- src/main/org/apache/tools/ant/taskdefs/optional/javah/SunJavah.java 4 Feb
2005 08:08:07 -0000 1.1
+++ src/main/org/apache/tools/ant/taskdefs/optional/javah/SunJavah.java 7 Feb
2005 22:25:12 -0000
@@ -16,7 +16,10 @@
*/
package org.apache.tools.ant.taskdefs.optional.javah;
+import java.io.File;
+
import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.launch.Locator;
import org.apache.tools.ant.taskdefs.ExecuteJava;
import org.apache.tools.ant.taskdefs.optional.Javah;
import org.apache.tools.ant.types.Commandline;
@@ -40,22 +43,25 @@
public boolean compile(Javah javah) throws BuildException {
Commandline cmd = setupJavahCommand(javah);
ExecuteJava ej = new ExecuteJava();
-
+ Class c = null;
try {
try {
// first search for the "old" javah class in 1.4.2 tools.jar
- Class.forName("com.sun.tools.javah.oldjavah.Main");
- cmd.setExecutable("com.sun.tools.javah.oldjavah.Main");
+ c = Class.forName("com.sun.tools.javah.oldjavah.Main");
} catch (ClassNotFoundException cnfe) {
// assume older than 1.4.2 tools.jar
- Class.forName("com.sun.tools.javah.Main");
- cmd.setExecutable("com.sun.tools.javah.Main");
+ c = Class.forName("com.sun.tools.javah.Main");
}
} catch (ClassNotFoundException ex) {
throw new BuildException("Can't load javah", ex,
javah.getLocation());
}
+ cmd.setExecutable(c.getName());
ej.setJavaCommand(cmd);
+ File f = Locator.getClassSource(c);
+ if (f != null) {
+ ej.setClasspath(new Path(javah.getProject(), f.getPath()));
+ }
return ej.fork(javah) == 0;
}
@@ -117,4 +123,4 @@
return cmd;
}
-}
\ No newline at end of file
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]