Search code examples
windowsant

How to set ANT_HOME with Windows?


How can I easily set ANT_HOME under Windows? I added "D:\Installz\apache-ant-1.8.2\bin;" to my system environment variable PATH and I also created an ANT_HOME variable.


Solution

  • I expect you to be running on Windows (since you are using %). Simply add a new environment variable (Right-click on My Computer > Properties > Advanced > environment Variable) or using SET ANT_HOME=<path> using command line (in that cas, it will only be active on that command line).

    Once set you should be able to verify its value by doing echo %ANT_HOME% in command line

    The % sign around the variable indicates it is an environment variable.

    For linux use the export ANT_HOME=<path> in command line or in your ~/.profile (persistent, require logout/login). Use echo $ANT_HOME for verification.