Windows – “ant” is not recognized as command in Windows

androidcommand linewindows 7

This is my first time developing Android applications. I'm developing an Android app on Eclipse on Windows 7. I would like to run the Android app from the Windows 7 command line interface. I have my Android device connected to the PC.

The workspace directory that I use to store the Android project is

C:\Users\Guest\Desktop\Software Applications Development\Java\Android Moblie Applications Projects\Eclipse Indigo for Java EE x64-bit\project workspace

I opened the command line interface and I changed the working directory to the Android workspace directory.

cd C:\Users\Guest\Desktop\Software Applications Development\Java\Android Moblie Applications Projects\Eclipse Indigo for Java EE x64-bit\project workspace

I included Android sdk platform tools directory into the PATH environment variable.

c:\Users\admin\Android-sdks\platform-tools

Then I entered this into the Windows 7 command line interface:

ant debug

I have this error message on the cmd:

ant is not recognised as an internal or external command, operatable program or batch file.

What is the solution to this problem?

Best Answer

ant is not a part of standard Android SDK setup. You'll have to install it.

  • Download the latest ant zip file from The Apache Ant Project.
  • Extract the zip file to a folder, say c:\ant\
  • Add c:\ant to your path environment variable

Once these are done, you'll be able to run ant from the command line

Related Question