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 Problems with Ant 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 "Problems with Ant" Watch "Problems with Ant" New topic
Author

Problems with Ant

Rafael Afonso
Ranch Hand

Joined: Jul 16, 2002
Posts: 63
Hello:
I am using Ant 1.5.1 with Windos 98. In Autoexec I typed this:

But when I try run Ant in DOS prompt I got this message:

ANT_HOME is set incorrectly, or ant could not be located. Please set ANT_HOME

This is strange, because when I type "echo %ANT_HOME%" it prints the correct directory. Anyway, if ANT_HOME was not correctly set, I had not run ant.
Anyone can help me?
Thanks,


=================================<br /> Rafael U. C. Afonso<br /> <a href="http://www.javafree.com.br" target="_blank" rel="nofollow">www.javafree.com.br</a><br />=================================<br /><i>Where is debug?<br />debug is on the table</i>
Greg Charles
Sheriff

Joined: Oct 01, 2001
Posts: 2835
    
  11

That is weird. Another proof that ANT_HOME is set correctly is that you use that variable in the PATH, and are able to run the program. The only thing I can suggest is when you run ant, you are executing ant.bat. You could go look at that file to see where the logic is failing. You can even throw in echo statements to see what the flow is, and to confirm you're actually calling that script in the first place.
Rafael Afonso
Ranch Hand

Joined: Jul 16, 2002
Posts: 63
Greg:
I read ant.bat and I perceived that it waits that ANT_HOME must be "C:\ant". Well, I moved ANT from c:\java\jakarta-ant-1.5.1 to c:\ant and changed ANT_HOME. And it works! It is strange because I do not see anywhere that ANT must be in a particular directory.
Thanks,
[ March 20, 2003: Message edited by: Rafael Afonso ]
Greg Charles
Sheriff

Joined: Oct 01, 2001
Posts: 2835
    
  11

The ANT_HOME environment variable is supposed to be what makes it possible to put Ant in any directory. If ANT_HOME is not set at all, then the script looks for Ant in various places, including c:\ant. Still, I'm not sure what's happening on your system. You could try:
echo %ANT_HOME%
at the top of that script. With a few strategically placed echo statements, I bet you can figure out what's going on. (You might want to back up the original ant.bat before you start messing with it. )
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problems with Ant
 
Similar Threads
Problem of run ant come with jwsdp1.3
error in run Ant in Jwsdp1.3
Ant installation
ant 1.6.0 bin distribution not working
problems with ant installation