Reputation: 1291
I did download the apache-ant-1.8.4 and unzip the folder then placed into c drive after that I checked the apache-ant installed or not with command "ant -version" then command prompt gave me error like
'ant' is not recognized as an internal or external command,operable program or batch file.
I already set environment variable of Java and ant. please see my environment variable shown below..
ANT_HOME -> C:\apache-ant\apache-ant-1.8.4\bin
JAVA_HOME -> C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files\Java\jdk1.6.0_37\bin
I am using windows xp. please tell me where I am doing wrong. I trying lot but not achieve my goal. please somebody help me to solve this bug. Thanks in advance.
Upvotes: 1
Views: 1906
Reputation: 20618
Ant is not installed, it is unzipped into any folder you wish.
If you open a command prompt and try to run any executable, it is your operating system (Windows in this case) that searches for it. Where does it search? In the current directory (Windows does that, Linux fortunately not), and in all directories that are part of the PATH environment variable.
What I always do (and I always recommend):
1) Add an environment variable ANT_HOME pointing to the directory, where you placed Ant. For example ANT_HOME = C:\apache-ant\apache-ant-1.8.4
. Have a look: this variable does not point to the bin
directory.
2) Add the following to your PATH variable:
PATH = ...;%ANT_HOME%\bin
This is the same way, I also do with Java, Maven, JBoss, and whatever tool I use. If you ever change your installation (maybe also to a new directory), you must only change the appropriate home variable. The path will be adjusted automagically.
EDIT (I just saw your JAVA_HOME
variable)
Change your JAVA_HOME
variable to contain C:\Program Files\Java\jdk1.6.0_37
. Then add this also to the PATH
variable:
PATH = ...;%JAVA_HOME%\bin
Upvotes: 0
Reputation: 11
Try This :
- set your environment variable on System properties
a: variable : ANDROID_HOME
value : your Path\phonegap\sdk
b: variable : ANT_HOME
value : your Ant HOme\java\apache-ant-1.9.2
I hope this help for your problem solve
Upvotes: 1