Yes, this is the normal behaviour of CLASSPATH.
And it is the behaviour of ant pre 1.6.

For some reason that I cannot understand, people set CLASSPATH to include ".", making
the issue worse as random jar files then get picked up, and in WINDOWS these
files cannot be deleted!


Peter

Antoine Levy-Lambert wrote:

Hi Peter,

is the problem that :

if there is a directory /foo/bar in the classpath before starting ant, then all jars present in /foo/bar will go into the classpath used by ant,
while the good behavior would be that only classes under /foo/bar such as /foo/bar/com/... go into the classpath ?


Antoine


Peter Reilly wrote:


Does anyone know the reason why the launcher code in ant 1.6 gets the jars in a directory specified in the CLASSPATH and adds them to ant's classpath ?

It does seem to be a strange thing to do.

Lancher.java: line 128
               if (element.isDirectory()) {
                   // add any jars in the directory
                   URL[] dirURLs = Locator.getLocationURLs(element);
                   for (int j = 0; j < dirURLs.length; ++j) {
                       libPathURLs.add(dirURLs[j]);
                   }
               }


It may be an oversight - -lib <path> is used to pass the CLASSPATH to ant in the ant script. So the code that parses this lib <path> is the same code that parses the normal -lib option to ant.

Perhaps we need to be the CLASSPATH in a different manner in Launcher,java ?

either explicitly or implicitly ?

Peter




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to