Adam Heath wrote:
> Bilgin Ibryam wrote:
>> I don't know if this is the final fix, but I still can't run ant
> 
> Use ./ant or ./ant.bat.
> 
> If you want to use a globally installed ant, then you have to make that
> work yourself.  If you can't figure out how, then respond here, and I'll
> tell you.
> 
> If so inclined, I could come up with an ant shell script wrapper, that
> one could install into $HOME/bin, that checks to see if $PWD is in an
> ofbiz tree, and call the local version, otherwise the global.

Ok, sorry, I should have included more info into what was happening with
this.

Classloaders in java are heirachal.  If a child loader delegates to it's
parent first, before trying it's own system of loading.  And, once a
class is loaded from some loader, any other classes that it references
in it's bytecode have to come from that same loader, or their parents.

In this particular case, the loader that loads the main ant classes has
to be able to find the <scriptdef> task; this is due to it being an
internal extension, not some <taskdef> addition.  Which means the
ant-nodep.jar needs to be on the same classloader as main ant.

Then, once <scriptdef> is loaded, it tries to probe for JSR223
support(scripting, included by default in java 1.6), then bsf.  Since
this is a bytecode dependency, it again has to be in the same global
classloader.

I'm wondering if I could try to use <taskdef> to create <scriptdef>;
this would allow for moving them out of global, *if* it works.

Reply via email to