ant: command not found

Have You tried accessing the binary with the full path?

Maybe Your $PATH variable doesn't contain the default paths? echo $PATH should give something like:

[root@server ~]# echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

If it's empty, You may set the PATH variable with this command

export PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin"

On CentOS possible default full paths are:

/usr/bin/ant - from package: ant
/usr/share/ant/bin/ant - from package: ant
/usr/lib64/eclipse/plugins/org.apache.ant_1.7.1.v20100518-1145/bin/ant - from package: eclipse-platform

You may install the required package with command yum install {package}

On Debian possible default full paths are:

/usr/bin/ant - from package: ant
/usr/share/ant/bin/ant - from package: ant
/usr/lib/eclipse/plugins/org.apache.ant_1.8.3.v20120321-1730/bin/ant - from package: eclipse-platform-data

You may install the required package with command apt-get install {package}
Error in other languages:
ant: bevel nie gevind nie
ant: comandă negăsită
ant: comando não encontrado
ant: commande introuvable
ant: command not found
ant: käsku ei ole
ant: không tìm thấy lệnh
ant: komanda nerasta
ant: Kommando nicht gefunden.
ant: kommandot finns inte
ant: komut yok
ant: nie znaleziono polecenia
ant: níor aimsíodh an t-ordú
ant: no se encontró la orden
ant: no s'ha trobat l'ordre
ant: opdracht niet gevonden
ant: parancs nem található
ant: perintah tidak ditemukan
ant: príkaz nenájdený
ant: příkaz nenalezen
ant: команда не найдена
ant: командата не е открита
ant: 命令找不到
ant: コマンドが見つかりません