From dev-return-63602-apmail-ant-dev-archive=ant.apache.org@ant.apache.org Mon Feb 07 22:29:04 2005 Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 95228 invoked from network); 7 Feb 2005 22:29:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 7 Feb 2005 22:29:04 -0000 Received: (qmail 66259 invoked by uid 500); 7 Feb 2005 22:29:03 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 65917 invoked by uid 500); 7 Feb 2005 22:29:02 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 65901 invoked by uid 99); 7 Feb 2005 22:29:02 -0000 X-ASF-Spam-Status: No, hits=2.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,FORGED_YAHOO_RCVD X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from web30902.mail.mud.yahoo.com (HELO web30902.mail.mud.yahoo.com) (68.142.200.155) by apache.org (qpsmtpd/0.28) with SMTP; Mon, 07 Feb 2005 14:29:01 -0800 Received: (qmail 14174 invoked by uid 60001); 7 Feb 2005 22:28:59 -0000 Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=3Shmgu9vo6GtWWh2Xw+R30PJrAkhQjIH3MnjDKIUH81kc+D4/N8qWn9Lo82KbkmW4ixzy7Cv0FF1PqN3eGyMbZbufC+Bsqc04RcoWyhiSCFiRZ9Ea0LiweR0dO2uEb1xcoh46XwQ5EIXYrg+deyiDhj4dh7d4Waq45ldfVNCcYs= ; Message-ID: <20050207222859.14172.qmail@web30902.mail.mud.yahoo.com> Received: from [65.247.233.154] by web30902.mail.mud.yahoo.com via HTTP; Mon, 07 Feb 2005 14:28:59 PST Date: Mon, 7 Feb 2005 14:28:59 -0800 (PST) From: Matt Benson Subject: Re: javah To: Ant Developers List In-Reply-To: <20050207215202.45271.qmail@web30904.mail.mud.yahoo.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="0-689936463-1107815339=:12990" X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N --0-689936463-1107815339=:12990 Content-Type: text/plain; charset=us-ascii Content-Id: Content-Disposition: inline For the record, attached is the patch that makes SunJavah work for me: -Matt --- Matt Benson 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: > dev-unsubscribe@ant.apache.org > For additional commands, e-mail: > dev-help@ant.apache.org > > __________________________________ Do you Yahoo!? Yahoo! Mail - You care about security. So do we. http://promotions.yahoo.com/new_mail --0-689936463-1107815339=:12990 Content-Type: text/plain; name="SunJavah.patch.txt" Content-Description: SunJavah.patch.txt Content-Disposition: inline; filename="SunJavah.patch.txt" 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 +} --0-689936463-1107815339=:12990 Content-Type: text/plain; charset=us-ascii --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org --0-689936463-1107815339=:12990--