ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Parag Doke <parag.d...@gmail.com>
Subject Re: Ant not respecting JAVA_HOME
Date Tue, 23 Aug 2011 07:23:39 GMT
One more suggestion (same as the last email from Santanu) ...
Please try setting PATH to include JAVA_HOME\bin first and then the
existing PATH. So before you invoke ant from the cmd, type this:
set PATH=%JAVA_HOME%\bin;%PATH%

I suspect that the JRE installation has put some kind of java.exe
under some Windows folder (system32?). So when it invokes java.exe, it
picks up the Windows folder one rather than the one under
JAVA_HOME\bin.

If you can make your build.xml sleep for a minute and figure out the
path to the java.exe (I use ProcessExplorer free tool), this could be
confirmed.

Do let us know how this goes,
Parag Doke
Save paper, save trees. Do not print emails/documents unless
absolutely necessary.



On Mon, Aug 22, 2011 at 8:00 PM, Urena, Jose M (Jose)
<jose.urena@verizon.com> wrote:
> another tip, it is not pretty.
> in windows when paths have spaces, you can try using windows short names
>
> if you only have 1 dir that starts with "c:\Program"
> then the short name for "Program Files" is "progra~1"
>
> set JAVA_HOME="C:/progra~1/Java/jdk.1.6.0_23"
>
>
> the "dir /x c:\" can give you the short name for all files at c:\
>
> -----Original Message-----
> From: Parag Doke [mailto:parag.doke@gmail.com]
> Sent: Monday, August 22, 2011 10:26 AM
> To: Ant Users List
> Subject: Re: Ant not respecting JAVA_HOME
>
> The right syntax to include a value with spaces for batch files / cmd.exe is:
> set "variable=value with spaces"
> So, you should have used
> set "JAVA_HOME=C:\Program Files\Java\jdk.1.6.0_23"
>
> Not sure if this might help you original issue though. Did you try to comment the echo
off line (precede with "rem ") in ant.bat / ant.cmd under ANT_HOME/bin? Maybe, if you comment
that, you will see on the console what executable it is trying to run.
>
> Hope this helps,
> Parag Doke
> Save paper, save trees. Do not print emails/documents unless absolutely necessary.
>
>
>
> On Mon, Aug 22, 2011 at 7:27 PM, Brian FitzGerald <bmfitzgerald3@gmail.com> wrote:
>> Thanks for the help guys... this is what I got:
>>
>> WITH QUOTES:
>> C:\Users\Brian>cd C:\AntTest
>> C:\AntTest>set JAVA_HOME="C:\Program Files\Java\jdk.1.6.0_23"
>> C:\AntTest>set ANT_HOME="C:\Ant"
>> C:\AntTest>%ANT_HOME%\bin\ant
>> The syntax of the command is incorrect.
>>
>> WITHOUT QUOTES:
>> C:\Users\Brian>cd C:\AntTest
>> C:\AntTest>set JAVA_HOME=C:\Program Files\Java\jdk.1.6.0_23
>> C:\AntTest>set ANT_HOME=C:\Ant C:\AntTest>%ANT_HOME%\bin\ant Unable to
>> locate tools.jar. Expected to find it in C:\Program Files\Java\jre6\li
>> b\tools.jar
>> Buildfile: C:\AntTest\build.xml
>>
>> hello:
>>     [echo] Hello, World
>>
>> BUILD SUCCESSFUL
>> Total time: 0 seconds
>>
>> So with quotes it wouldn't run at all.  Without quotes, it ran, but
>> still is looking in the JRE directory.  Is now a good time to start
>> banging my head against the wall?
>>
>> Brian
>>
>>
>>
>> 2011/8/22 <andy.ling@quantel.com>
>>
>>> Santanu Basu <santanu.basu@tcs.com> wrote on 22/08/2011 14:07:02:
>>>
>>> > Have you done this?
>>> >
>>> > C:\Users\Brian>cd C:\AntTest
>>> > C:\AntTest>set JAVA_HOME=C:\Program Files\Java\jdk.1.6.0_23
>>> > C:\AntTest>set ANT_HOME=C:\Program Files\Apache Software
>>> > Foundation\apache-ant-1.8.2
>>> > C:\AntTest>%ANT_HOME%\bin\ant
>>> >
>>> > The above should work. Which version of Ant you are using?
>>> >
>>>
>>> Just to be sure, you should probably put quotes round those paths
>>> with spaces in.
>>>
>>> i.e.
>>> C:\AntTest>set JAVA_HOME="C:\Program Files\Java\jdk.1.6.0_23"
>>> C:\AntTest>set ANT_HOME="C:\Program Files\Apache Software
>>> Foundation\apache-ant-1.8.2"
>>>
>>> Regards
>>>
>>> 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-unsubscribe@ant.apache.org For
>>> additional commands, e-mail: user-help@ant.apache.org
>>>
>>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail:
user-help@ant.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

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


Mime
View raw message