Brian FitzGerald <bmfitzgera...@gmail.com> wrote on 22/08/2011 15:42:29:

> When I wrap the variable and value with quotes as Parag suggested it 
runs
> the build but still looks for Java in the jre directory.
> 

What I do is have a build.bat file that contains something like the 
following.
I don't have any spaces in paths, so you may need to add the quotes if you
do.


@echo off
SetLocal

set ROOT=C:\
set LIB=%ROOT%\Libs
set ANT_ROOT=%LIB%\ant
set JAVA_ROOT=%LIB%\Java

set ANT_HOME=%ANT_ROOT%\latest
set JAVA_HOME=%JAVA_ROOT%\latest

echo Setting up CLASSPATH
set CLASSPATH=%JAVA_HOME%\lib\tools.jar
set CLASSPATH=%CLASSPATH%;%ANT_HOME%\lib\ant.jar
set CLASSPATH=%CLASSPATH%;%ANT_HOME%\lib\ant-launcher.jar
echo.
echo CLASSPATH=%CLASSPATH%
echo.

set action=all
IF not "x%1" == "x" set action=%1
echo.
echo Ant action: %action%
echo.

%JAVA_HOME%\bin\java "-Dant.home=%ANT_HOME%" -ea org.apache.tools.ant.Main 
%action% %2 %3 %4 %5 %6

I then run ant by calling build.bat "target"

Hope that helps

Andy Ling

-- 

This e-mail is intended for the named addressees only. Its contents may be 
privileged or confidential and should be treated as such. If you are not 
an intended recipient please notify the sender immediately and then delete 
it;  do not copy, distribute, or take any action based on this e-mail. In 
the pursuit of its legitimate business activities and its conformance with 
relevant legislation, Quantel may access any e-mail (including 
attachments) it originates or receives, for potential scrutiny. 

Quantel is the trade name used by Quantel Holdings Limited and its 
subsidiaries.  Quantel Holdings Limited is registered in England & Wales. 
Registration No: 4004913 
Contact details for all Quantel Offices and Companies can be found on our 
website www.quantel.com or by writing to the holding company.
Registered address: Turnpike Road, Newbury, Berkshire, RG14 2NX, United 
Kingdom 

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

Reply via email to