You are not logged in.
Pages: 1
Topic closed
Hi,
I required the ant tool from apache-ant, and after installing that package, ant still cannot be found.
# ant
bash: ant: command not found
Any idea?
Offline
It is found in /usr/share/java/apache-ant/bin/ant . Add the directory to your $PATH if you just want to be able to run "ant".
See the FAQ.
Useful for this kind of thing: pacman -Ql packagename | grep bin
Offline
Hi,
I required the ant tool from apache-ant, and after installing that package, ant still cannot be found.
# ant
bash: ant: command not foundAny idea?
relogin or source /etc/profile.d/apache-ant.sh
Give what you have. To someone, it may be better than you dare to think.
Offline
wow insanely helpful, thanks!
Offline
i ran into the same problem,
when trying to install java-service-wrapper from AUR.
pikaur -S java-service-wrapper
fails with
/home/user/.cache/pikaur/build/java-service-wrapper/PKGBUILD: line 38: /etc/profile.d/apache-ant.sh: No such file or directory
in my view,
the 'best practice' for a package to locate apache-ant should be:
1. try $ANT_HOME from env
[2. try source /etc/profile]
[3. try ANT_HOME=/usr/local/ant]
4. try ANT_HOME=/usr/share/ant
5. fail with 'ant not found'
in a PKGBUILD file this would look like
[ -z "$ANT_HOME" ] && ANT_HOME=/usr/share/ant && PATH="$PATH:$ANT_HOME/bin"
this order proceeds
from 'most user customized'
to 'most default'
/usr/share/ant is the default ant path in
jpackage = binary ant release
debian
ubuntu
fedora
/usr/local/ant is the default ant path
in the ant source release
[see file apache-ant-1.10.5/build.xml line 1251]
when user compiled ant from source,
that should be preferred over the binary version in /usr/share/ant
at last,
user can set a custom ANT_HOME ....
.... either persistent in profile
for example in the file
/etc/profile.d/apache-ant.sh
export ANT_HOME=/usr/share/ant
export PATH=$PATH:$ANT_HOME/bin
which is source-d from /etc/profile
= run: source /etc/profile
[reloading /etc/profile feels a bit wrong,
since that should be done by bash on login,
and bash source-s more files than /etc/profile,
like ~/.bash_profile and ~/.bash_login and ~/.profile]
.... or temporary in env
by export-ing ANT_HOME in the current terminal
--
i talked to anthraxx about this,
[anthraxx the package maintainer of apache-ant]
he recommends
packages should try ANT_HOME=/usr/share/ant
if the ANT_HOME variable is empty.
/etc/profile.d/apache-ant.sh
[or similar config file] is only needed,
if ant was installed outside of /usr/share/ant
Last edited by mila.nuts (2018-10-09 09:38:05)
Offline
Welcome to the forums mila.nuts
Please take the time to familiarise yourself with the forum Code of Conduct, especially the section regarding necro-bumping.
Am going to send this old thread back to sleep for good - Closing.
Offline
Pages: 1
Topic closed