Reputation: 361
Apparently iam to dumb to get ant running.
When i click on the ant symbol in the /bin
Folder where i unziped everything
then there is the message:
Ant could not be found. Plz set ANT_HOME.
Same when i click on the ant Symbol in my Eclipse Sub folder.
So i tried to fix the environment variable in Windows 8
.
In the menu Computer-Properties-Environmentvariable i find two different variable Settings. One is for my user and one is for system.
I did add ANT_HOME variable with path: C:\Users\Rhino\Downloads\apache-ant-1.9.6-bin\apache-ant-1.9.6 and i did add %ANT_HOME&\bin;
I tried both for user and for system.
Where am i going wrong?
Upvotes: 2
Views: 7884
Reputation: 21389
According to ant manual, it uses following three environment variables, so please make sure, they are in place.
The ant.bat script makes use of three environment variables - ANT_HOME, CLASSPATH and JAVA_HOME. Ensure that ANT_HOME and JAVA_HOME variables are set, and that they do not have quotes (either ' or ") and they do not end with \ or with /. CLASSPATH should be unset or empty.
In short, you might missed to add %ANT_HOME%\lib
to CLASSPATH
environment variables.
The following are to explain little more for better understanding :
And implicitly, the respective bin directories of JAVA_HOME, ANT_HOME
to be added to PATH
variable as well in order to work from any in the command prompt.
I can see from the description that you are aware of environment variables. And like you mentioned, yes there are two settings. If you define the variables in the below, those works for all the users of the computer and if variables are defined for user, then those works for only specific user.
Here giving an example values for the above variables,so that if there is any difference, then you should be able to correct in your environment.
Java is installed in d:\softwares\jdk1.8.0
Ant is installed in d:\softwares\apache-ant-1.9.4
Now the environment variable must be defined as:
variable `JAVA_HOME`, value is `d:\softwares\jdk1.8.0` variable `ANT_HOME`, value is `d:\softwares\apache-ant-1.9.4` variable `CLASSPATH`, value is `%ANT_HOME%\lib` variable `PATH`, add `;%JAVA_HOME%\bin;%ANT_HOME%\bin;` to existing `PATH` at the beginning.
Once the above are set, you should be able to test by opening a new command prompt, and run command ant
and then you should be able to see the below(assuming that there is no build.xml file in that current directory):
Buildfile: build.xml does not exist!
Build failed
Otherwise, if the configuration is not set properly, you would not see the above. If the above is shown means, the cofiguration is set correctly.
Upvotes: 0
Reputation: 335
You can normally specify ANT_HOME in Eclipse by right-clicking the ant build.xml, then navigating to Run As > Ant Build...
Then under the Classpath tab, you should see User Entry for Ant Home (Default). If not, then you can select the Ant Home... button on the right and then navigate to where Ant is on your system.
Clicking Apply, then Run should kickoff the Ant build.
Upvotes: 3