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. 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. 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.
0 Comments
Leave a Reply. |