ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sean Kelly" <>
Subject ExecuteJava creates incorrect AntClassLoader
Date Sat, 27 Jan 2001 02:12:04 GMT
I'm seeing a problem with <java> execution.

Here's the deal: I'm trying to run a Java program called
BuildDependency, a thing from Dallas Semiconductor that
acts as a linker/converter for Java programs before they
can be run on a TINI, a Java virtual machine on a SIMM.

BuildDependency takes a list of .class and .jar files,
loads them with its own class loader, operates on their
constant pools, checkes references, and otherwise
converts the whole thing into a file you can transfer to
a TINI and run.  BuildDependency comes in a file called
tini.jar, filled with various other TINI utilities.

When I run BuildDependency from Ant via <java>, and
tini.jar isn't in my CLASSPATH, and I use the classpath
attribute to point to tini.jar, it works.

If I remove the classpath attribute and put tini.jar in
my CLASSPATH, it works.

But if I have the classpath attribute *and* tini.jar in
my CLASSPATH, it doesn't work, failing with:

/home/saffron/kelly/junk/therm/build.xml:45: java.lang.IllegalAccessError:
try to access class WatchDog from class BuildDependency
java.lang.IllegalAccessError: try to access class WatchDog from class
        at BuildDependency.replaceVariables(
        at BuildDependency.getDependencies(
        at BuildDependency.main(
        at java.lang.reflect.Method.invoke(Native Method)

Now, if I modify the way ExecuteJava gets the
AntClassLoader, I can get it to work, by changing:

    AntClassLoader loader = new AntClassLoader(project, classpath);


    AntClassLoader loader = new AntClassLoader(project, classpath,

Question is, why isn't this the case in the Ant source?
If the user's specified a classpath attribute in his
<java> task, should that be used preferentially
(systemFirst=false) to the system CLASSPATH?


View raw message