How to find out the correct path for ANT_HOME in Linux?
On CentOS/Ubuntu ANT_HOME should be /usr/share/ant/. You can check /usr/share/ant/bin/ant, it's just a bash script
# load system-wide ant configuration (ONLY if ANT_HOME has NOT been set)
if [ -z "$ANT_HOME" -o "$ANT_HOME" = "/usr/share/ant" ]; then
if [ -f "/etc/ant.conf" ] ; then
. /etc/ant.conf
fi
fi
So if you didn't specify explicitly ANT_HOME, /usr/share/ant will be used by default.
Related videos on Youtube
automatix
Updated on September 18, 2022Comments
-
automatix over 1 year
I'm using Ubuntu
14.04
(on a VirtualBox VM) and installed Apache Ant viaaptitude
:$ aptitude install ant
The binary is stored in
/usr/bin/
:$ which ant /usr/bin/ant
Now I want to set
ANT_HOME
and also add it to myPATH
environment variable. On Windows it would be easy to find the correct folder --ANT_HOME
is the folder, where the installation is stored and looks likeC:\Program Files\Apache Ant
(or simply the parent directory of the folder with the Ant binaries).How to find out the correct path for
ANT_HOME
in a Linux system (e.g. Ubuntu Server)?
UPDATE
The documentation on the Oracle website says:
Add the following lines to the file, substituting the directory where you installed Ant:
ANT_HOME=/apache-install-dir/apache-ant-version
How to find out the path to the
apache-install-dir
?-
Alin Andrei about 8 yearsuse export ANT_HOME='/usr/bin', or use this link provided by oracle
-
automatix almost 8 years@AlinAndrei Thanks for your comment, but what I'd actually like to know is not how to set the environment variable, but how to know / how to find out, which path for
ANT_HOME
is correct on a Linux machine. So did you mean, theANT_HOME
is always the folder with executables, where the Ant executable is?
-
-
automatix almost 8 yearsThank you very much fr your answer! Could you please (if possible) add a reference to it, where you have the info from. Thanks
-
ALex_hha almost 8 yearsAs I have told above, I've just checked the script /usr/share/ant/bin/ant