Error Installing Ant: Ant_Home Is Set Incorrectly

ANT_HOME is set incorrectly or ant could not be located

ANT_HOME might be set, but that doesn't mean the path to /bin is in your PATH so the OS can find it.

Add ANT_HOME/bin to your PATH and the OS will be able to find ant.bat.

Error installing Ant: ANT_HOME is set incorrectly

It sounds like you have it setup right. What happens if you try something like this, which worked for me:

C:\>set ANT_HOME=C:\apache-ant-1.8.1

C:\>set JAVA_HOME=C:\jdk1.6.0_24

C:\>set PATH=%ANT_HOME%\bin;%JAVA_HOME%\bin

C:\>ant -version
Apache Ant version 1.8.1 compiled on April 30 2010

This also worked for me by setting up environment variables, like so:

Ant Env

ANT_HOME is set incorrectly or ant could not be located. Please set ANT_HOME

It turns out that the zip file I downloaded for ant is not correct. I got another one with .tar.gz as its extension then it works. @ankur-singhal Thanks for your help.

ANT_HOME set correctly but couldn't run ant

ANT_HOME is in reality set incorrectly as ANT_HOME refers to path upto ant installation directory which is parent directory of bin.and you have set path upto bin which is incorrect.

do the following

ANT_HOME = C:\Users\Rahul\Downloads\apache-ant-1.8.4

Error installing Ant: ANT_HOME is set incorrectly

It sounds like you have it setup right. What happens if you try something like this, which worked for me:

C:\>set ANT_HOME=C:\apache-ant-1.8.1

C:\>set JAVA_HOME=C:\jdk1.6.0_24

C:\>set PATH=%ANT_HOME%\bin;%JAVA_HOME%\bin

C:\>ant -version
Apache Ant version 1.8.1 compiled on April 30 2010

This also worked for me by setting up environment variables, like so:

Ant Env

How to set ANT_HOME with Windows?

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.



Related Topics



Leave a reply



Submit