Tuesday, March 11, 2014

Ant tool on Mac Maverick 10.9.2

Apple as usually is playing a game with developers:

$ ant clean
-bash: ant: command not found

$ xcode-select --install
xcode-select: note: install requested for command line developer tools
- Agree
- Finding Software
- Server not available 

Another way:

$ which brew
- nothing
$ ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

$ brew install ant
==> Downloading http://www.apache.org/dyn/closer.cgi?path=ant/binaries/apache-ant-1.9.3-bin.tar.gz
Error: Failed to download resource "ant"
Couldn't determine mirror, try again later.

Trying another approach:

@ ~ $ brew install homebrew/dupes/ant
Cloning into '/usr/local/Library/Taps/homebrew-dupes'...
error: RPC failed; result=7, HTTP code = 0
fatal: The remote end hung up unexpectedly
@ ~ $ ant

-bash: ant: command not found

Another approach:
got to http://ant.apache.org/bindownload.cgi
for half a day I was getting server error, but finally in the evening I was able to download:

upzip it
$ cd /usr/local/apache-ant-1.9.3/bin
$ ./ant
Buildfile: build.xml does not exist!
$ edit ~/.profile

Add this to your .profile file

export ANT_HOME=/usr/local/apache-ant-1.9.3
export PATH=${PATH}:${ANT_HOME}/bin

Save and Restart terminal 

Now ant command works from any directory.