The Netbeans IDE is bundled with Apache Ant, which Netbeans projects use to build projects.  At times it can be useful to build a Netbeans project from the command line, but ‘ant’ won’t work by default on Windows unless you set some environment variables first.  On the command line:

set JAVA_HOME=%programfiles%\Java\<your-jdk-version>
set ANT_HOME=%programfiles%\NetBeans 8.0\extide\ant
set PATH=%PATH%;%ANT_HOME%\bin

Adjust as required to your version of Netbeans and JDK.  To set these environment variables permanently, open the System Properties (Windows 7: Start -> Computer -> Properties -> Advanced System Settings -> Environment Variables) and create the new variables.

Tagged with →  
Share →