Question

I'm having a very weird issue with the command line and running Ant. I point the path variable at the location of my Ant bin directory (C:\Ant\bin) and when i go into a command window and type PATH it shows the location in it. But when I go to run Ant by typing "ant" it does nothing and states that it isn't recognized. But when I go to the run window (Windows+R) and type "ant" it runs it.

I have restarted Windows twice and the problem still persists. I am running Windows Vista Ultimate with SP1 installed. I have tried "Running as Administrator" with no difference.

Any one experience anything like this before?

Was it helpful?

Solution

Sometimes you can set a system-wide (or even just personal) Environment Variable and it'll cure it, as opposed to just setting it in your shell.

Go to the Control-panel, then System, then Advanced, and look for the button on Environment Variables. From there, you can follow your nose.

Good luck.

OTHER TIPS

Ant also depends on Java to be on the path. Do you have that?

I would also check to make sure the environment variables ANT_HOME and JAVA_HOME are set up properly in the console.

Is there any chance that the command window you are trying to run Ant in is a different window to the cmd windwo where you set up and verify that its in the path? If the PATH is updated after a cmd window is already open it won't recongnise the change. Not clear if that might be your issue.

If you are in the dir C:\Ant\bin and type "ant" does it recognise it?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top