File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Ant, Maven and Other Build Tools and the fly likes Ant does not work, keep getting Can't find configuration file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Ant does not work, keep getting Can Watch "Ant does not work, keep getting Can New topic
Author

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

Peter Flori
Greenhorn

Joined: Jul 03, 2012
Posts: 2
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

Joined: Oct 01, 2001
Posts: 2771
    
  10

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

Joined: Jul 03, 2012
Posts: 2
Thanks, that helps
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Ant does not work, keep getting Can't find configuration file
 
Similar Threads
J2EE RI Servers
gem directory not find
"Error in ant build.xml file"
Mod_jk NEED HELP!!!
problem in web services