ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Conor MacNeill <>
Subject Re: new Launcher and CLASSPATH
Date Thu, 18 Sep 2003 13:36:47 GMT
On Wed, 17 Sep 2003 08:29 pm, Stefan Bodewig wrote:
> So far all our documentation more or less states that putting your jar
> containing custom tasks into ANT_HOME/lib or pointing to it in your
> CLASSPATH was equivalent.  This is no longer true if the new launcher
> is used.


> As ant.jar cannot be found on the system classloader anymore, any
> class loaded from the system classloader (i.e. classes coming from
> CLASSPATH) can't load the Task class for example.
> I see two options:
> (1) live with it and document it properly (which means people may have
> to link/copy a lot into ANT_HOME/lib).

Yes. I think we should recommend that Ant be run with an empty CLASSPATH. I 
have added an option ot read libs out of a home directory and would like to 
add an option to specify arbitrary lib directories with a -lib option or 
similar. The only drag is that the command processing would need to be done 
in the launcher to extract this info and then pass the rest of the command 
line to the Main class.

> (2) Fix all tasks that load classes - like Definer - to delegate to
> the classloader created in Launcher instead of the system classloader.

I don't think this will work. No matter which classloader you use to find the 
class, if it is found on the system class loader it will try to load 
dependent classes with the same loader. 

>  Or the classloader
> created in Launcher must be the parent of the created AntClassloader
> instances (probably the better solution).

I expect that to be the case anyway.

> Also, I'm not sure whether build.sysclasspath is going to work as
> expected when used with the new launcher.  It seems as if the code in
> Launcher that resets the java.class.path system property should take
> care of it, but I'm not entirely sure.  If we wanted to test it via
> Gump (which uses build.sysclasspath=only), we first need to find a
> solution for my first issue above.

True - may not be compatible with my empty CLASSPATH recommendation above.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message