0

I am trying to install ANT on a Mac laptop. I installed Java 8 Then downloaded ANT and unzip it to /Users/ANT/ In .bash_profile I put export PATH=${PATH}:/Users/ANT/bin

But when I try to call an ant from the command (ant –version) line I recieve

zsh: command not found: ant

Any ideas? Thank you!

1
  • If you're trying to install ANT for a non-Salesforce use, then you'd be better off asking this on Stack Overflow. If you are planning to use this for Salesforce, ANT is an outdated method for deploying things and you should be looking at the Salesforce CLI instead.
    – Derek F
    Commented Apr 14, 2022 at 18:52

2 Answers 2

0

Based on the error message it appears that you are running the command from Z shell (zsh) but you've added the path to ant to your bash profile which requires you to use the bash shell.

Since you are using zsh, you'll need to add export PATH=${PATH}:/Users/ANT/bin to your ~/.zshrc

0

Based on error message "command not found: ant", seem to path is not properly set in environment variables.

After installing ant, move it to /usr/local/ using this command mv /Users/admin/Downloads/apache-ant-1.9.4 /usr/local/

Now try to set environment variables using nano $HOME/.profile

Check below lines.

export PATH=$PATH:/usr/local/ant/bin/
export ANT_HOME=/usr/local/ant
export  JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.7.0._71..jdk/Contents/Home/bin

Load variables by executing source $HOME/.profile and run ant -version.

Check Apache Ant installation on Mac OS here (1), (2) and similar issue details.

Thanks

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .