You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Patrick Surry <Pa...@quadstone.com> on 2004/11/30 21:29:08 UTC

Make the tools.jar warning less alarming?

This has likely come up before, but if you run Ant with a JRE instead of a JDK, 
you get an alarming message like this:

...
Unable to locate tools.jar. Expected to find it in
/home/ruby6/dh/QuadstoneSystem5.0C/server/jre/solaris/1.4.2_03/lib/tools.jar
...

But for my application, I don't need any of the java compilation tasks and Ant 
works just fine with a JRE and my custom tasks, so I suggest changing the 
message to something like below, which isn't so worrisome and gives you a clue 
as to what to do if it really is a problem:

...
Note: java compilation tasks unavailable - if needed, provide JDK tools.jar
via CLASSPATH, -lib or in D:\QS50C\server\jre\win32\1.4.2_03\lib
...

This is just a change to the println in 
org/apache/tools/ant/launch/Locator.java's getToolsJar() function:

     if (!toolsJar.exists()) {
//PDS changed message
         System.out.println(
"Note: java compilation tasks unavailable - if needed, provide JDK tools.jar\n" +
"via CLASSPATH, -lib or in " + toolsJar.getParentFile().getPath());
//PDS end
         return null;
     }

Anyway, I'm not a developer and don't have CVS access, but thought someone 
might agree this was a good idea and want to pick it up.

Regards,
Patrick

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