ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Edoardo Vacchi <uncommonnonse...@gmail.com>
Subject Re: Ant System Class Loader does not honor $CLASSPATH, honors $LOCALCLASSPATH
Date Wed, 27 Mar 2013 09:06:09 GMT
Ok, I think I've found my problem. The fact is the system classloader
is never updated, but the context classloader is. So, all I have to do
is to substitute any instance of

    ClassLoader cl = ClassLoader.getSystemClassLoader();

with

    ClassLoader cl = Thread.currentThread().getContextClassLoader();

The context class loader seems to actually honor -lib and $CLASSPATH


On Wed, Mar 27, 2013 at 9:07 AM, Edoardo Vacchi
<uncommonnonsense@gmail.com> wrote:
> On Tue, Mar 26, 2013 at 11:43 PM, Rainer Noack <rainer@noacks.net> wrote:
>
>> if you're launching ant via shell script, it is using
>> oata.launcher.Launcher.java
>>
>> This class reorganises the classpath a bit.
>
> [...]
>
> Hi Rainer,
> then how can I pass to the new ClassLoader a custom classpath? (which
> is in fact the path(s) to the jar(s) that contains the taskdef'd
> task?)
>
> e.v.

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


Mime
View raw message