You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Ravi Roy <ra...@gmail.com> on 2006/12/01 16:26:05 UTC

How to refer PATH environment variable in Ant task

Hi All,

 

I want to refer the environment variable in created in Windows XP using
<exec> Ant task, but it does not seem to refer that.

 

My purpose is to run java.exe along with executing the application and
referring ZIP/JARs by the application at execution time from the PATH
variable.

 

<property environment="env" />

 

<target name="main">

          <exec dir="${project.root}/classes" executable="java.exe">

             <env key="PATH" path="${env.PATH} />

              <arg
line="-XrunpiAgent:mode=full,server=standalone,profile=myprofile,filters=myf
ilters.txt,file=trace.trcxml com.mycomp.test.MyApp" />

          </exec>

 </target>

 

or there is some limit in terms of maximum characters specified on the
command line ?

 

Thanks for pointers in advance!

 

Regards.

Ravi.

 

 

 

 

 

 

 

 

 


Re: How to refer PATH environment variable in Ant task

Posted by Tommy Nordgren <to...@chello.se>.
On 1 dec 2006, at 16.26, Ravi Roy wrote:

> Hi All,
>
>
>
> I want to refer the environment variable in created in Windows XP  
> using
> <exec> Ant task, but it does not seem to refer that.
>
>
>
> My purpose is to run java.exe along with executing the application and
> referring ZIP/JARs by the application at execution time from the PATH
> variable.
>
>
>
> <property environment="env" />
>
>
>
> <target name="main">
>
>           <exec dir="${project.root}/classes" executable="java.exe">
>
>              <env key="PATH" path="${env.PATH} />
>
>               <arg
> line="- 
> XrunpiAgent:mode=full,server=standalone,profile=myprofile,filters=myf
> ilters.txt,file=trace.trcxml com.mycomp.test.MyApp" />
>
>           </exec>
>
>  </target>
>
>
>
> or there is some limit in terms of maximum characters specified on the
> command line ?
>
>
>
> Thanks for pointers in advance!
>
>
>
> Regards.
>
> Ravi.
>
	For running java, you should probably use the java task!!!!!
------
What is a woman that you forsake her, and the hearth fire and the  
home acre,
to go with the old grey Widow Maker.  --Kipling, harp song of the  
Dane women
Tommy Nordgren
tommy.nordgren@chello.se




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


Re: How to refer PATH environment variable in Ant task

Posted by Gilbert Rebhan <an...@schillbaer.de>.
Hi,

if nothing else works you may still go via =

<target name="main">
    <exec dir="..." executable="the/whole/path/to/java.exe">
<arg line="..." />
    </exec>

  </target>

Regards, Gilbert


Ravi Roy wrote:
> 
> I want to refer the environment variable in created in Windows XP using
> <exec> Ant task, but it does not seem to refer that.
> 
> My purpose is to run java.exe along with executing the application and
> referring ZIP/JARs by the application at execution time from the PATH
> variable.

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