try the following under DOS:

set ANT_HOME=D:\jakarta-ant-1.5.1
then
echo %ANT_HOME%

if this does work then no reason why this should not work into a batch file; it not, 
then write this line into ur ant.bat file and skip (rem) the lines that do the 'if 
exist "%ANT_HOME%" goto' check.

ur script can be as simple as follows:

set _CP_=%ANT_HOME%\lib\ant.jar^
%MAVEN_HOME%\repository\jaxp\jars\jaxp-1.2.jar;^
%MAVEN_HOME%\repository\xml-apis\jars\xml-apis-2.0.2.jar;^
%MAVEN_HOME%\repository\xalan\jars\xalan-2.3.1.jar;^
%MAVEN_HOME%\lib\commons-logging-1.0.1.jar;^

rem move MAVEN_HOME to watever is the correct path

set JAVA_HOME=C:\jdk1.3.1

%JAVA_HOME%\bin\java -Xmx256m -classpath %JAVA_HOME%\lib\tools.jar;%_CP_% 
-Dlog4j.configuration=log4j.properties org.apache.tools.ant.Main %*

then u may want to add the ant.bat path into ur %PATH% which seems to work in ur case.

seb.

Jim Cobban wrote:

> I have downloaded and unzipped the ant 1.5.1 package.  I have set ANT_HOME and 
>JAVA_HOME as described in the installation instructions.  However no matter what I 
>set ANT_HOME to when I type ant I get:
>
> ANT_HOME is set incorrectly or ant could not be located. Please set ANT_HOME.
>
> The environment variables are:
>
> D:\MyPrograms\JavaProgs\CensusServlet\ReadXls>set
> ANT_HOME=D:\jakarta-ant-1.5.1
> JAVA_HOME=C:\jdk1.3.1
> PATH=C:\WINDOWS;C:\WINDOWS\COMMAND;C:\JDK1.3.1\BIN;D:\JAKARTA-ANT-1.5.1\BIN
>
> There is only one thread I can see on this subject in the archives, it peters out 
>with a suggestion that the problem might be the backslash, but changing this to a 
>forward slash makes no difference.
>
> When I turn echo on I find that execution of ant.bat merrily flows right through the 
>'if exist "%ANT_HOME%" goto' statement, even though the directory definitely exists.  
>Moreover when I experiment I find that it does not matter WHAT I put in the "if 
>exist" statement control flows through.  Does "if exist" even work on Win98?
>
> I would really like to use ant.  It is a real pain to have to keep editting the 
>shell scripts that I am using to compile my applications.
>
> Jim Cobban   [EMAIL PROTECTED]
> 34 Palomino Dr.
> Kanata, ON, CANADA
> K2M 1M1
> +1-613-592-9438


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to