Tutorial :How to install Apache Ant?



Question:

I want to install SMSlib (http://smslib.org/) in installation instruction (http://code.google.com/p/smslib/wiki/Installation).

In here I must install Apache Ant, but I didn't understand how to do that. I already download Apache Ant 1.7.1 , read manual (http://ant.apache.org/manual/index.html)

In here I must have RPM version from jpackage.org right? I already go to http://www.jpackage.org/ after that what must I do? I already try (http://mirrors.dotsrc.org/jpackage/1.7/generic/free/repodata/) and (http://www.jpackage.org/browser/browse.php?jppversion=1.7) but too many link. I don't know witch one must I download


Solution:1

If you're on Windows, you can use WinAnt, a Windows installer for Apache Ant that I made.


Solution:2

Step 1: Download and install

Download Ant. Go to the Ant homepage and click to download the binary. Because we’re talking about Windows, choose to download the ZIP file rather than any of the others. Scroll down to where it says “Current release of Ant” and click on the ZIP filename.

Once downloaded, unzip the file. You’ll now need to choose a permanent home for Ant on the computer. c:\java\ant is often used, but you can put it wherever you want.

Step 2: Set environment variables

For Windows XP: To set environment variables on Windows XP, right click on My Computer and select Properties. Then go to the Advanced tab and click the Environment Variables button at the bottom.

For Windows 7: To set environment variables on Windows 7, right click on Computer and select Properties. Click on Advanced System Settings and click the Environment Variables button at the bottom. The only environment variable that you absolutely need is JAVA_HOME, which tells Ant the location of your JRE.

If you’ve installed the JDK, this is likely

c:\Program Files\Java\jdk1.x.x\jre  

on Windows XP and

c:\Program Files(x86)\Java\jdk1.x.x\jre  

on Windows 7. You’ll note that both have spaces in their paths, which causes a problem. You need to use the mangled name[3] instead of the complete name. 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

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.

This variable is a semicolon-delimited list of directories to search for executables. 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. You’ll need to add both of these to the end of the PATH variable. For Windows XP, you’ll likely add something like this:

;c:\java\ant\bin;C:\Progra~1\Java\jdk1.x.x\jre\bin  

For Windows 7, it will look something like this:

;c:\java\ant\bin;C:\Progra~2\Java\jdk1.x.x\jre\bin  

Done

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. You should be able to simply run ant and see something like this:

Buildfile: build.xml does not exist!  Build failed  

That means Ant is installed properly and is looking for a build.xml file.

Source: http://www.nczonline.net/blog/2012/04/12/how-to-install-apache-ant-on-windows/


Solution:3

You can follow these instrunctions-

1)Download the latest version of ant from http://ant.apache.org/bindownload.cgi

2)Unzip and save it to your C:\ directory as ant.

3)Add the bin directory to your PATH environment variable.

4)Add the ANT_HOME environment variable set to C:\ant.

you can use following commands to set ANT_HOME variable

C:>set ANT_HOME=C:\ant

C:>set JAVA_HOME=C:\jdk

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

C:>ant -version

Apache Ant version 1.8.1 compiled on April 30 2010

if you have java installed on your machine

5)Add the ANT_OPTS environment variable set to -Xmx256M.

This is all you need to install ant on your machine.


Solution:4

1) Download "apache-ant-1.8.4-bin.zip" from "http://ant.apache.org/bindownload.cgi"

2) Unzip it and copy "apache-ant-1.8.4" in "c:\Program Files"

3) Right Click "My Computer" -> properties -> Advanced -> Environment variables -> Edit variable "PATH" and append value "C:\Program Files\Java\jdk 1.7.0_04\bin;C:\Program Files\apache-ant-1.8.4\bin" and Click "OK".

4) open cmd and type "ant" for checking.


Solution:5

the installation of ant and smslib is pretty simple. All you need to do is extract it to some directory. Export the path in case of Linux or set the ANT_HOME\bin to the PATH variable to access it from any directory in the shell. ANT_HOME is the root directory where ant is installed.

For SMSLib Download the zip file and this link should guide you on a step by step basis


Solution:6

Sound's like you're using Linux. If so, the easiest way would be to use a package management frontend like Synaptic and install ant in there.


Solution:7

Its very simple just install Apache ant installer for windows give on [link][1]

[1]: http://code.google.com/p/winant/ and all is set.No need to set Environment variables.It will automatically do every thing for you.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »