You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Cels M." <mi...@hotmail.com> on 2005/09/28 18:57:06 UTC

How to set native OS variables?

Hi,

    I need to set the native OS classpath and them <exec> an application. 
I've been reading the ant docs and several usenet posts but didn't find a 
way to do it. It's quite simple to retrieve the OS properties but, is there 
any way to set them ?

    Thanks in advance,

        - Juan

_________________________________________________________________
Don't just search. Find. Check out the new MSN Search! 
http://search.msn.com/


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: How to set native OS variables?

Posted by Ninju Bohra <ni...@yahoo.com>.
Oops, you are right... the <sysproperty> element is
for setting JVM system properties (during a <java>
task)
The <env> element of the <exec> is correct

--- Robert Clark <ro...@quest.com> wrote:

> On Wednesday September 28, 2005 12:57 pm, "Cels M." 
> <mi...@hotmail.com> wrote:
> >     I need to set the native OS classpath and them
> <exec> an
> > application. I've been reading the ant docs and
> several usenet
> > posts but didn't find a way to do it. It's quite
> simple to retrieve
> > the OS properties but, is there any way to set
> them ?
> 
> Its possible to set environment variables passed to
> <exec>'ed 
> processes with nested <env> elements. The
> documentation for the 
> <exec> task shows a couple of examples. 
> 
> Something like this should do the trick for you:
> 
> <exec executable="something">
>   <env key="CLASSPATH" value="/opt/classes:....."/>
> </exec>
> 
> - Rob
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 
> 






		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: How to set native OS variables?

Posted by Robert Clark <ro...@quest.com>.
On Wednesday September 28, 2005 12:57 pm, "Cels M." 
<mi...@hotmail.com> wrote:
>     I need to set the native OS classpath and them <exec> an
> application. I've been reading the ant docs and several usenet
> posts but didn't find a way to do it. It's quite simple to retrieve
> the OS properties but, is there any way to set them ?

Its possible to set environment variables passed to <exec>'ed 
processes with nested <env> elements. The documentation for the 
<exec> task shows a couple of examples. 

Something like this should do the trick for you:

<exec executable="something">
  <env key="CLASSPATH" value="/opt/classes:....."/>
</exec>

- Rob

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: How to set native OS variables?

Posted by Ninju Bohra <ni...@yahoo.com>.
Try looking at the <sysproperty> sub-elements of the
<exec> task, it allows you to define system properties
that will be set on the process that is hosting the
executable...

Later,

Ninju

--- "Cels M." <mi...@hotmail.com> wrote:

> Hi,
> 
>     I need to set the native OS classpath and them
> <exec> an application. 
> I've been reading the ant docs and several usenet
> posts but didn't find a 
> way to do it. It's quite simple to retrieve the OS
> properties but, is there 
> any way to set them ?
> 
>     Thanks in advance,
> 
>         - Juan
> 
>
_________________________________________________________________
> Don't just search. Find. Check out the new MSN
> Search! 
> http://search.msn.com/
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 
> 






		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org