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_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:
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
Maven Compilation Error: (Use -Source 7 or Higher to Enable Diamond Operator)
Spring Boot How to Hide Passwords in Properties File
Flutter Doctor --Android-Licenses Gives a Java Error
Make Arraylist.Toarray() Return More Specific Types
Java:Parse Java Source Code, Extract Methods
Entry Point for Java Applications: Main(), Init(), or Run()
Setting Jvm Heap Size at Runtime
CSV Parsing in Java - Working Example
How to Test Void Method with Junit Testing Tools
What Goes into the "Controller" in "Mvc"
How to Get the Threadpoolexecutor to Increase Threads to Max Before Queueing
How to Pick an Item by Its Probability
How to Copy a Java.Util.List into Another Java.Util.List
Calling a Mapreduce Job from a Simple Java Program