You are not logged in.

#1 2010-03-01 13:05:50

nubity
Member
Registered: 2009-11-29
Posts: 46

ant not found!

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

#2 2010-03-01 13:39:29

Bralkein
Member
Registered: 2004-10-26
Posts: 354

Re: ant not found!

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

#3 2010-03-01 13:52:02

wonder
Developer
From: Bucharest, Romania
Registered: 2006-07-05
Posts: 5,941
Website

Re: ant not found!

nubity wrote:

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?

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

#4 2010-03-01 15:29:14

nubity
Member
Registered: 2009-11-29
Posts: 46

Re: ant not found!

wow insanely helpful, thanks!

Offline

#5 2018-10-09 09:09:11

mila.nuts
Member
Registered: 2018-10-09
Posts: 2

Re: ant not found!

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

#6 2018-10-09 09:46:17

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: ant not found!

Welcome to the forums mila.nuts smile

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.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

Board footer

Powered by FluxBB