I'm writing a script to automate compilation of java projects, and using ant for the same. When I run the ant command directly in bash shell it builds the project properly. However, if I run the exact same command from a shell script, I'm getting the following error:
./build.sh: line 21: Apache: command not found
Line 21 in my build.sh file is:
`ant clean build -v -buildfile $BUILDFILE`
where $BUILDFILE=auto_build.xml.
I've also added the path to ant bin folder in .bashrc
$ANT_HOME has the value /usr/share/ant
ant -version gives me Apache Ant(TM) version 1.9.3 compiled on April 8 2014 (This command also does not work if added to a shell script)
which antin your script to verify that you running the right ant command.which ant=/usr/share/ant