0

I have batch scripts , the problem is when I run setup.bat it sets JAVA_HOME , ANT_HOME temporarily then I can run build.bat. If I run build.bat only ant calls gives error. Any idea what is going on here ?

Setup.bat 

@echo off
REM ----- BUFFER SIZE-------
mode con:cols=140 lines=9999
REM ------ Change Directory For Java Home ----- 
set PATH=%BASEPATH%
set ANT_HOME=d:\Tools\apache-ant-1.9.4
set JAVA_HOME=d:\Tools\jdk7x64\jdk1.7.0_55
set PATH=%ANT_HOME%\bin;%JAVA_HOME%\bin;D:\Tools\scripts;%PATH%

Build.bat

REM ----- Drive Selection ------
cd /d "D:\"
cd D:\Work\parser\trunk
call ant -f  build.xml clean devbuild 
cd D:\Work\dm\v3.2 
call ant -f build.xml clean devbuild
user3498019
  • 95
  • 1
  • 2
  • 10
  • 1
    Why do you want to run build.bat without setting up the environment properly from setup.bat first? – JonK May 28 '14 at 10:39
  • yeah it works in that way , but I want set HOMEs once and remain like that ! I don't want to run setup.bat all the time. – user3498019 May 28 '14 at 10:40
  • That's what Environment Variables are for - it sounds like you haven't got Ant or Java setup properly. See http://stackoverflow.com/questions/2619584/how-to-set-java-home-on-windows-7?rq=1 for more details on how to do that – JonK May 28 '14 at 10:43
  • I dont want to set Environment Variables using GUI , I want to set it using cmd thats what I am asking , I know how to set EV from GUI. – user3498019 May 28 '14 at 10:50
  • Ah, in that case you'll want to take a look at this question: http://stackoverflow.com/questions/5898131/set-a-persistent-environment-variable-from-cmd-exe – JonK May 28 '14 at 10:54
  • in that page there is solution but that what does hen broadcast a WM_SETTINGCHANGE in that case ? – user3498019 May 28 '14 at 11:40
  • I would use the highest voted answer on that particular question rather than the accepted answer (i.e. using the SETX command if you can). – JonK May 28 '14 at 12:47

0 Answers0