ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Richard S. Hall" <>
Subject IllegalAccessError
Date Fri, 02 Feb 2001 10:58:06 GMT
I am using Ant 1.2 with JDK 1.3 under Windows 98.  I read about the 
IllegalAccessError problem in the archives, but it didn't give me an 
adequate explanation.

I have a public class, let's call it Public, with a static main which i 
use the java task to execute.  In the constructor of this class I create 
an instance of another class who's constructor is protected, let's call 
this Protected.  Both Public and Protected are in the same package, so 
Public should be able to create an instance of Protected.  Alas, I 
cannot do so in Ant.

I understand why Ant must use its own classloader, because I am 
specifying my own class path on the fly which consists of JAR files that 
are created in the build file.  But I have created my own class loaders 
before and I have not run into this type of problem, this is perfectly 
legal stuff.  Is this problematic because Ant must use reflection to 
call the static main method?

I cannot use forking since I need standard input and I would prefer not 
to run an additional JVM anyway.  This seems like pretty reasonable 
limitation.  Am I missing something?

-> richard hall

View raw message