I'm hardly a 'heavyweight' but I believe that (and the docs indicate that) <jvmarg> just goes on the command line before the classname, as opposed to <arg> which goes after (passed to the called Java program. <sysproperty> _does_ do the equivalent of -Dname=value. <env> sets an environment variable. My question is _why_ doesn't env work for <java> where fork="yes"?
-danch Kyle Adams wrote: > Hmm... my impression from the Ant 1.4.1 manual was that <jvmarg> ends up as a >-Dname=value on the command line after java.exe (but obviously before whatever class >is being called), and <sysproperty>, to quote, "specify system properties required by >the class." > > Any of the Ant heavyweights want to weigh in on this? > > >>>>[EMAIL PROTECTED] 05/10/02 12:07PM >>> >>>> > <sysproperty> sets a Java system property (what appears as -Dname=value on > the java.exe command line), while <env> sets a system environment variable. > Not the same at all. --DD > > -----Original Message----- > From: Kyle Adams [mailto:[EMAIL PROTECTED]] > Sent: Friday, May 10, 2002 10:05 AM > To: [EMAIL PROTECTED] > Subject: RE: How do I force ant to fail? > > 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]>
