I am installing ant on a Windows XP machine, and am following the instructions at Apache’s manual site. It said to set JAVA_HOME, so I checked, saw there was no environment variable named JAVA_HOME, made one, and set it to “C:\Program Files\Java\jdk1.6.0_19”
When I try to run ant debug, however, it tells me that JAVA_HOME is currently set to “C:\Program Files\Java\jre6”
I’m guessing JAVA_HOME isn’t an environment variable. But if it isn’t one, I’m at a loss as to where to start looking for it. Anybody know?
Edit: Oh yeah – it’s bugging me for tools.jar as well, but I’m guessing that when I fix the JAVA_HOME issue, that will help the terminal find tools.jar as well. Or maybe I’m wrong. Thanks
Following on Newtopian’s suggestions, you can quickly confirm if that behavior is the problem by running in the terminal
Also, I’m not sure if the text you entered into the JAVA_HOME environment variable is literally “C:\Program Files\Java\jdk1.6.0_19”, i.e., with quotes, but if so, you should remove the quote marks as they’ll throw off ant.bat.
Here’s the relevant bit from ant.bat
If that doesn’t help, could you post your debug task?
Two options to make it permanent:
Run this:
(basically, ensure you only have one JAVA_HOME set and it’s correct; be sure to close and reopen the terminal after doing this)
If all else fails, the crappy batch file solution:
save as
ant_wrapper.bat(or whatever) and you should be able to doant_wrapper debug.(Both of these solutions are untested)