Monday, April 7, 2014

Installing Apache ant

Ant is a favorite build tool for most of front-end developers & is an excellent choice for JavaScript also. Ant install is like a breeze on MAC but is a bit tricky on Windows. The instructions below are only for Windows 7.

  1. Make sure JDK is installed already from http://bit.ly/V7yv7Z. For my purpose I have used x86 version instructions would also be on the same lines.
  2. Download the .zip for the binaries from http://ant.apache.org/bindownload.cgi.
  3. Extract the binaries on the path C:java\ant\ where [java] and [ant] would be self created folders you can store in any directory structure of your preference.
  4. Set up Environment variables with the names JAVA_HOME & ANT_HOME.
  5. To set up the variables › Right Click My Computer › Click Properties › Click Advanced system settings  › Click Environment Variables › Click New System Variable.
  6. For ant variable name would be ANT_HOME and value would be c:\java\ant\.
  7. For JDK depending on the version and platform i.e. x86 the path would be c:\Program Files (x86)\Java\jdk1.7.0_09. The version 1.7.0_09 might only differ if you have installed the x86 platform base of JDK in the default location seleted by JDK installer.
  8. Open Command Prompt & from there go to c:\java\ant\bin and type command ant and you should get the message Buildfile: build.xml does not exist!
    Build Failed!
  9. This means ant is installed properly and looking for build.xml
  10. If you want to be able to run ant command from anywhere while inside Command prompt need to add your ant path in my case which is C:\java\ant\bin to Path environment variable there will be other paths also there each separated by semi-colon(;).

No comments: