2
votes

I try to integrate zxing on my android studio project and I need Apache Ant for it. I followed this steps for Apache Ant install: http://www.mkyong.com/ant/how-to-apache-ant-on-mac-os-x/ but when I finish to follow all those steps from link, I receive this message:

-bash: ant: command not found

1
it doesn't work for me come on! I know you can explain better. Even if this question is a perfect fit for Ask DifferentThomas Ayoub
I edited my question.:)Adela Toderici
Thanks! What's the output of echo $PATH?Thomas Ayoub
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/mkyong/gradle/bin:/Users/mkyong/apache-maven-3.1.1/bin:/Users/mkyong/apache-ant-1.9.6/binAdela Toderici
it's better if you edit the question :) What's the output of ls /Users/ ?Thomas Ayoub

1 Answers

2
votes

Given the output of echo $PATH:

/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/mkyong/gradle/bin:/Users/mky‌​ong/apache-maven-3.1.1/bin:/Users/mkyong/apache-ant-1.9.6/bin 

It seems that you have followed the link instructions a bit too much here (step 3):

export JAVA_HOME=$(/usr/libexec/java_home)
export GRADLE_HOME=/Users/mkyong/gradle
export M2_HOME=/Users/mkyong/apache-maven-3.1.1

# Apache Ant
export ANT_HOME=/Users/mkyong/apache-ant-1.9.4

# Export to PATH
export PATH=$PATH:$GRADLE_HOME/bin:$M2_HOME/bin:$ANT_HOME/bin

Since mkyong refers to the writter's username. So just do the same with your username (you can get it by running whoami in terminal) and it should do the trick.