I am getting following error while doing build using ANT:
rem bug ID 32069: resetting an undefined env variable changes the errorlevel.
if not "C:\Program Files (x86)\Java\jdk1.6.0_30\bin\java.exe" == "" set _JAVACMD=
if not "" == "" set ANT_CMD_LINE_ARGS=
I understand that ANT is not able to point to JDK. I am starting ANT build via .bat
file and there I am specifying following
set JAVA_HOME=C:\Program Files (x86)\Java\jdk1.6.0_30
set ANT_HOME=C:\Softwares\apache-ant-1.8.4
If add double quotes to JAVA_HOME value, I get following error:
if exist "C:\Softwares\apache-ant-1.8.4\lib\ant.jar" goto checkJava
set _JAVACMD=
Files was unexpected at this time.
if ""C:\Program Files (x86)\Java\jdk1.6.0_30"" == "" goto noJavaHome
Confusing part is if I change ANT_HOME to a previous version (1.6) it works fine.
set ANT_HOME=C:\Softwares\Ant
This seems to be related to the 32bit JDK on a 64 bit Windows but I'm not sure about that.
What worked for me was using the old ~ trick which apparently still works. So in your case it should probably be:
Notice that progra~2 maps on my machine to the x86 program files directory. Might be different on yours so you need to check that.