HERE is the entire instructions for installing and running Ant
.
you need to install jdk
(available here) and set the JAVA_HOME
environment variable to jdk's installation directory and add %JAVA_HOME%/bin
to the PATH
variable. See HERE for setting environment variables.
similarly, you need to install Ant
and set ANT_HOME
environment variable to Ant's installation directory and add %ANT_HOME%/bin
to the PATH
variable. See the 1st Link, at the start.
close any open command-prompt
windows, to reflect the changes.
When you need JDK
functionality (such as for the <javac>
task or the <rmic>
task) in Ant
, then tools.jar
is required. This tools.jar is present in JDK
but not in JRE
. See JDK and JRE file Structure
currently your JAVA_HOME
is pointing to, probably, /opt/jre1.7.0_51
and thus, while running ant it is searching for tools.jar under the /opt/jre1.7.0_51/lib
folder. you need to install jdk
if you haven't and change JAVA_HOME
to point to the installation directory of JDK, for eg. /opt/jdk1.7.0_60
.