Ant is a build tool. For some tasks (for example javac, javadoc) the tools
from the Java _Development_ Kit are required.
If you run with just a Java _Runtime_ Environment most of its tasks could be
used, but not all - hence the warning.

Set your JAVA_HOME to the installation path of your JDK.

http://ant.apache.org/manual/install.html#installing
"Optionally, set the JAVA_HOME environment variable (see the Advanced
section below). This should be set to the directory where your JDK is
installed."

http://ant.apache.org/manual/install.html#advanced
"When you need JDK functionality (such as for the javac task or the rmic
task), then tools.jar must be added. The scripts supplied with Ant, in the
bin directory, will add the required JDK classes automatically, if the
JAVA_HOME environment variable is set."


Jan

> -----Ursprüngliche Nachricht-----
> Von: Soni, Ashish IN BLR STS [mailto:ashish.s...@siemens.com]
> Gesendet: Dienstag, 28. April 2015 06:41
> An: user@ant.apache.org; gruener.heinr...@web.de
> Betreff: RE: tools.jar not found
> 
> In windows system, SET JAVA_HOME e.g. "SET JAVA_HOME=C:\Program Files
> (x86)\Java\jdk1.8.0_31" before running the ant build file.
> 
> -----Original Message-----
> From: John J. Hughes II [mailto:johnhug...@function-g.com]
> Sent: Monday, April 27, 2015 11:13 PM
> To: 'Ant Users List'; gruener.heinr...@web.de
> Subject: RE: tools.jar not found
> 
> Run what with JDK?
> 
> Run it with the jdk.
> Am 27.04.2015 um 18:26 schrieb John J. Hughes II:
> > All,
> >
> >
> >
> > I have searched online and can't fine and answer so please bear with
> me.
> >
> >
> >
> > When I run ANT it says it can't find tools in the JRE lib, why is it
> > looking there?
> >
> >
> >
> > If I copy tools.jar from the JDK to the JRE lib it works fine but
> that
> > will break on the next update so I would prefer to fix it correctly.
> >
> >
> >
> > I have rebooted and retested.
> >
> >
> >
> > There are no extra JDK or JRE values in the path, path simplified to
> > only show useful values.
> >
> >
> >
> > I dumped the SET values to text files and search and don't fine any
> > references to JRE there either.
> >
> >
> >
> > In settings:
> >
> > PATH = .;%JAVA_HOME%\bin;%ANT_HOME%\bin;
> >
> > Converts to:
> >
> > PATH  = .;C:\Program
> > Files\Java\jdk1.8.0_05\bin;C:\devenv\apache-ant-1.9.4\bin;
> >
> >
> >
> > C:\Projects>SET JAVA_HOME
> >
> > JAVA_HOME=C:\Program Files\Java\jdk1.8.0_05
> >
> >
> >
> > C:\Projects>SET ANT_HOME
> >
> > ANT_HOME=C:\devenv\apache-ant-1.9.4
> >
> >
> >
> > Error:
> >
> > C:\Projects>ant -version
> >
> > Unable to locate tools.jar. Expected to find it in C:\Program
> > Files\Java\jre1.8.0_45\lib\tools.jar
> >
> > Apache Ant(TM) version 1.9.4 compiled on April 29 2014
> >
> >
> >
> > So what am I doing wrong, thanks.
> >
> > John
> >
> >
> >
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@ant.apache.org For additional
> commands, e-mail: user-h...@ant.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@ant.apache.org For additional
> commands, e-mail: user-h...@ant.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscr...@ant.apache.org For additional
> commands, e-mail: user-h...@ant.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@ant.apache.org
For additional commands, e-mail: user-h...@ant.apache.org

Reply via email to