Java Mailing List Archive

Apache Ant Archive

» Ant Users List
» Ant Developers List
How to refer PATH environment variable in <exec > Ant task

How to refer PATH environment variable in <exec > Ant task

2006-12-04       - By Dominique Devienne
Reply:     <<     11  

> the other half is solved by the <env key being case
> insensitive for ant 1.7 so:
> <property environment="env" upcasekeys="yes"/>
> ..
>  <exec ...>
>      <env key="PATH" path="${env.PATH};${my_extra_path}"/>
> would always work.

How is <env> made case-insensitive? Imagine I pass in the current
path (let's assume the env. var is named Path) thru a CLI user property
(named PATH) and I want to write:

<exec ...>
 <env key="PATH" path="${PATH};${extra-path}" />

For this to work properly on Windows, the env. var. passed to Java's
exec facility must be named Path, and not PATH. How will <exec>
know that? Will it force the loading of all env. vars even though I need
to load them explicitly in the scenario above?

What case will <env> use for the PATH env. var? --DD

To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 - Jax Systems, LLC, U.S.A.