I get this really annoying message when working with ant on Linux.
I export my ANT_HOME=/home/ganesh/org.apache.ant_1.9.2.v201404171502/bin
Then i modify my path such as export PATH=$ANT_HOME:$PATH
. But then when i run ant i get the error as Error: Could not find or load main class org.apache.tools.ant.launch.Launcher
. Should there be a bin at the end of the ANT_HOME variable? If i remove it, it still does not work. what is the issue? Could someone help? Thanks.
Advertisement
Answer
The ANT_HOME should point to the installation direcotry of ant. In this case, assuming the installation directory is org.apache.ant_1.9.2.v201404171502 and its layout is as follow
/home/ganesh/org.apache.ant_1.9.2.v201404171502/{bin, lib, docs, etc}
then ANT_HOME should be
export ANT_HOME=/home/ganesh/org.apache.ant_1.9.2.v201404171502
And the PATH should point to the directory having the ant binaries. such as
export PATH=$ANT_HOME/bin:$PATH