You need to update your PATH environment variable. If you already created the ANT_HOME environment variable, add this to your PATH:
PATH = "(current_path);%ANT_HOME%\bin"
Question
Whenever I am trying to run the following command I am gettign the ant not installed error.
C:\MyApp\Android\MySpe\Audio>cordova platform add android
Creating android project...
C:\Users\atulc\.cordova\lib\android\cordova\3.4.0\bin\node_modules\q\q.js:126
throw e;
^
Error: ERROR : executing command 'ant', make sure you have ant installed and add
ed to your path.
at C:\Users\atulc\.cordova\lib\android\cordova\3.4.0\bin\lib\check_reqs.js:4
7:27
at ChildProcess.exithandler (child_process.js:641:7)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Socket.<anonymous> (child_process.js:956:11)
at Socket.EventEmitter.emit (events.js:95:17)
at Pipe.close (net.js:465:12)
Error: C:\Users\atulc\.cordova\lib\android\cordova\3.4.0\bin\create.bat: Command
failed with exit code 8
at ChildProcess.whenDone (C:\Users\atulc\AppData\Roaming\npm\node_modules\co
rdova\src\superspawn.js:126:23)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Process.ChildProcess._handle.onexit (child_process.js:810:5)
I have also updated my Environment variable accrodingly but still getting the above mentioned error:-
ANT_HOME : C:\ant JAVA_HOME:C:\Program Files\Java\jdk1.7.0_21\ and path variable as well..
Any help is really appreciated..
La solution
You need to update your PATH environment variable. If you already created the ANT_HOME environment variable, add this to your PATH:
PATH = "(current_path);%ANT_HOME%\bin"