File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Ant, Maven and Other Build Tools and the fly likes ant not recognized... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "ant not recognized..." Watch "ant not recognized..." New topic

ant not recognized...

Joey Doodle

Joined: Aug 02, 2006
Posts: 2

This is my first time trying to run ant and I get the message that "ant is not recognized as an internal or external command"

I know this has to do with my environment variables, but I'm not sure what I'm missing. Ant is installed on a server called bfdevbuild. Listed below are my environment variables and their values.

Does anyone see what I'm missing?



\\bfdevbuild\tools\ant\bin\;%ANT_HOME%\bin;%JAVA_HOME%/jre/bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\NetManage\Windows;C:\Program Files\Microsoft SQL Server\80\Tools\BINN;C:\Program Files\SQLLIB\BIN;C:\Program Files\SQLLIB\FUNCTION;C:\Program Files\SQLLIB\HELP;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Microsoft SQL Server\80\Tools\Binn\;C:\Program Files\Microsoft SQL Server\90\Tools\binn\;C:\Program Files\Microsoft SQL Server\90\DTS\Binn\;C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\PrivateAssemblies\;c:\j2sdk1.4.2_09\bin\

\\bfdevbuild\j2sdk1.4.2_09\lib\tools.jar;.;C:\Program Files\SQLLIB\java\;C:\Program Files\SQLLIB\java\;C:\Program Files\SQLLIB\java\;C:\Program Files\SQLLIB\bin;C:\Program Files\Java\j2re1.4.2_09\lib\ext\

Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24199


Welcome to JavaRanch!

The thing that's relevant to that message is the PATH, and that looks fine, if[/if] there's a file named \\bfdevbuild\tools\ant\bin\ant.bat accessible from your system. If there isn't, then find where ant.bat really is, and change the PATH to point to its exact directory.

If it [i]is
there, then perhaps you just need to close your terminal window and open a new one so it picks up these new environment variables.

[Jess in Action][AskingGoodQuestions]
I agree. Here's the link:
subject: ant not recognized...
It's not a secret anymore!