Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problems with Ant

 
Rafael Afonso
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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,
 
Greg Charles
Sheriff
Posts: 2984
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2984
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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. )
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic