Sorry but I'm making an assumption you're on a windows machine:
So you type ant at the command prompt and it's not recognized:
the directory to the ant.bat file is not in your PATH
You try to run ant from within and
IDE and it's not recognized:
Some applications require you to configure a path to the ant bat/exe file directory.
You should try the configuration menu to see how this is supported. Often the fix above with the path is all that is needed though.