That means Ant is installed properly and is looking for a build.xml file. You should be able to simply run ant and see something like this: Buildfile: build.xml does not exist! For example, one of the Ant targets will. The structure will consist of folders, together with Ant scripts and property files. You will start by setting up a folder and file structure for deploying a NetBeans Platform application.
#How to use apache ant how to
Once you’ve done that and applied the changes, you’ll need to open a new command prompt to see if the variables are set properly. This document shows you how to use Ant and the command line to set up and deploy NetBeans Platform applications.
For Windows XP, you’ll likely add something like this: c:\java\ant\bin C:\Progra~1\Java\jdk1.x.x\jre\binįor Windows 7, it will look something like this: c:\java\ant\bin C:\Progra~2\Java\jdk1.x.x\jre\bin You’ll need to add both of these to the end of the PATH variable. To be able to run ant in any directory, Windows needs to know both the location for the ant binary and for the java binary. This variable is a semicolon-delimited list of directories to search for executables. That alone is enough to get Ant to work, but for convenience, it’s a good idea to add the Ant binary path to the PATH variable. So for Windows XP, use C:\Progra~1\Java\jdk1.x.x\jre and for Windows 7, use C:\Progra~2\Java\jdk1.6.0_26\jre if it’s installed in the Program Files(x86) folder You need to use the mangled name instead of the complete name. You’ll note that both have spaces in their paths, which causes a problem. On Windows XP and c:\Program Files(x86)\Java\jdk1.x.x\jre If you’ve installed the JDK, this is likely c:\Program Files\Java\jdk1.x.x\jre The only environment variable that you absolutely need is JAVA_HOME, which tells Ant the location of your JRE. Click on Advanced System Settings and click the Environment Variables button at the bottom. Then go to the Advanced tab and click the Environment Variables button at the bottom.įor Windows 7: To set environment variables on Windows 7, right click on Computer and select Properties. c:\java\ant is often used, but you can put it wherever you want.įor Windows XP: To set environment variables on Windows XP, right click on My Computer and select Properties. You’ll now need to choose a permanent home for Ant on the computer. Scroll down to where it says “Current release of Ant” and click on the ZIP filename.
#How to use apache ant zip file
Because we’re talking about Windows, choose to download the ZIP file rather than any of the others. Go to the Ant homepage and click to download the binary. Apache Ant is a build tool with special support for the Java programming language but can be used for just about everything.