As Steve pointed out, the online docs are now for Ant 1.5, beta 1 (I'm not to happy 
about that move, though I understand the rational behind it).  If you check the local 
documentation for your version of Ant (1.4, I believe?), you'll see that there's a 
<sysproperty> nested element.  Give that a try.

Kyle

>>> [EMAIL PROTECTED] 05/09/02 05:28PM >>>
Great suggestion. I tried:

<java classname="org.apache.tools.ant.Main" fork="yes" failonerror="yes">
  <arg line="-buildfile build.xml ${targetName}"/>
  <env key="JAVA_HOME" value="../build/jdk1.4"/>
  <classpath>
    <pathelement path="d:/proj/cajun/ant/lib/ant.jar"/>
  </classpath>
</java>

Except I get the following error:
D:\proj\cajun\unittest\build.xml:103: The <java> task doesn't support the nested
 "env" element.

Though the docs say it can. So it looks like I'm back to the exec, because the whole 
purpose is to set JAVA_HOME. 


-----Original Message-----
From: Kyle Adams [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, May 09, 2002 1:23 PM
To: [EMAIL PROTECTED] 
Subject: Re: How do I force ant to fail?


Whoops - clicked the wrong button on my previous attempt at a response.  
Anyhow, a suggestion if you don't want to use Ant 1.5, beta 1 - try calling ant 
with the <java> task.  For example:

<java classname="org.apache.tools.ant.Main" fork="yes" failonerror="yes">
    <arg line="-buildfile myBuildFile.xml"/>
    <classpath>
        <pathelement path="${{java.class.path}}"/>
    </classpath>
</java>

Kyle


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to