ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: Bug? JUnit and classpath problems. Ant classloader?
Date Fri, 06 Jul 2001 09:43:49 GMT
On Thu, 5 Jul 2001, Jérôme Lacoste
<> wrote:

> Note the '\' prefixing the name as it is a specific case of the

Shouldn't that be a forward slash?

> So I guess it is a problem in Ant. I though it was a classLoader
> problem.

I think it is.

> When I run Ant with -verbose, the JUnit tasks prints correctly the
> classpath I am passing, but my code (running in the same JVM) does
> not print the complete classpath (i.e. ${tests.classpath} as passed
> by the junit task) but prints the one created by the ant.bat script.

If you specify a nested classpath element, Ant will use a classloader
of its own, but not alter java.class.path - so you cannot see it

The getResource methods have not been implemented in Ant 1.3, but they
are supposed to work in the nightly builds.  Maybe the implementation
is not working correctly in all cases.

> I tried to fork the JVM and to force to pass the correct classpath
> by adding a sysproperty task before the junit one:

No, all you need is to set the classpath like you did, don't fiddle
with the system properties.

> This didn't work. Forking the JVM fails because I then have to set
> JUnit in my classpath, thing that I don't want.

Even if you don't want to do so, it would help to debug the current
situation.  Please add junit.jar and optional.jar to your defined
classpath and run the task in forked mode.


View raw message