• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Ant does not work, keep getting Can't find configuration file

 
Peter Flori
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All,
Could someone please help? I keep getting Can't find configuration file, aborting when trying to run ant command.
This is a Redhat linux enterprise server. The ant release is pretty old.
How can I force to install the latest ant release?

Here snapshot of the error:

root:[/] $ uname -a
Linux 2.6.18-274.17.1.el5 #1 SMP Wed Jan 4 22:45:44 EST 2012 x86_64 x86_64 x86_64 GNU/Linux
root:[/] $ yum install ant
Loaded plugins: product-id, rhnplugin, security, subscription-manager
Updating Red Hat repositories.
rhel-source | 1.2 kB 00:00
rhel-x86_64-server-5 | 1.4 kB 00:00
Setting up Install Process
Package ant-1.6.5-2jpp.2.x86_64 already installed and latest version
Nothing to do
root:[/] $ ant
Can't find configuration file, aborting
root:[/] $ ant --version
Can't find configuration file, aborting
root:[/] $ ant
Can't find configuration file, aborting
root:[/] $ ant help
Can't find configuration file, aborting
root:[/] $ ant ?
Can't find configuration file, aborting
root:[/] $ ant -diagnostic
Can't find configuration file, aborting
root:[/] $

Thanks,

 
Greg Charles
Sheriff
Posts: 2985
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Peter, welcome to JavaRanch!

It looks like your problem is with yum, not with ant. I can't help you with that, but if you absolutely can't get it working, you can always go "old school". Download the version of ant you want directly from Apache and extract it somewhere into your drive. I always like putting it into /opt, so I'd have /opt/ant/ant-1.8.4 for example. You then need to set the environment variable ANT_HOME and alter PATH to contain ANT_HOME/bin (and make sure that comes before any path entries that may pick up different versions of ant). Done!

I usually make an /opt/ant/default symbolic link to /opt/ant/ant-1.8.4, and set that to be my ANT_HOME. That makes it really easy to change versions. You just change the symbolic link.
 
Peter Flori
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, that helps
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic