Ant : As Build Tool :: Setup
Download Ant Setup |
You need following to have Ant based Java Project
- Download and install Ant
- Build a simple build.xml file for compilation and JAR file packaging
- Run Ant
Click here to download Ant installation binary Files
Install Ant |
You will find following zip file after download, click right and extract / unzip file.
I assume that you have JDK [Java Development Kit] installed in your System.
Now set PATH as Below on command prompt. You can also set in Environment PATH. Here i am doing on Console.
Setup PATH Before Execution |
Ant PATH Setup with version check and execution of build.xml file
F:\>set ANT_HOME=f:\apache-ant-1.9.0
F:\>set JAVA_HOME=C:\Program Files\Java\jdk1.7.0_03
F:\>set PATH=f:\apache-ant-1.9.0\bin
//Checking Ant Version
F:\>ant -version
Apache Ant(TM) version 1.9.0 compiled on March 5 2013
//Running ant and getting error since i don't have build.xml file in F: drive
F:\>ant build.xml
Buildfile: build.xml does not exist!
Build failed
F:\>
Ant command with other options
F:\>ant -help
ant [options] [target [target2 [target3] ...]]
Options:
-help, -h print this message
-projecthelp, -p print project help information
-version print the version information and exit
-diagnostics print information that might be helpful to
diagnose or report problems.
-quiet, -q be extra quiet
-silent, -S print nothing but task outputs and build failures
-verbose, -v be extra verbose
-debug, -d print debugging information
-emacs, -e produce logging information without adornments
-lib <path> specifies a path to search for jars and classes
-logfile <file> use given file for log
-l <file> ''
-logger <classname> the class which is to perform logging
-listener <classname> add an instance of class as a project listener
-noinput do not allow interactive input
-buildfile <file> use given buildfile
-file <file> ''
-f <file> ''
-D<property>=<value> use value for given property
-keep-going, -k execute all targets that do not depend
on failed target(s)
-propertyfile <name> load all properties from file with -D
properties taking precedence
-inputhandler <class> the class which will handle input requests
-find <file> (s)earch for buildfile towards the root of
-s <file> the filesystem and use it
-nice number A niceness value for the main thread:
1 (lowest) to 10 (highest); 5 is the default
-nouserlib Run ant without using the jar files from
${user.home}/.ant/lib
-noclasspath Run ant without using CLASSPATH
-autoproxy Java1.5+: use the OS proxy settings
-main <class> override Ant's normal entry point
F:\>
Recent Comments