To run the ant build from the command line, you must:
set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_24
C:\Program Files\NetBeans 7.1\java\ant\bin\