[kaffe] unexpected java.lang.IllegalAccessError

Timothy Stack stack at cs.utah.edu
Sun Sep 21 12:16:02 PDT 2003

> The attached program causes java.lang.IllegalAccessError
> when run with kaffe (ChangeLog head: 2003-09-13  Dalibor Topic
> <robilad at kaffe.org>).
> When run with JDK

Did you run it with '-verify' on?  I get something like:

516 irontown:tmp8/katest> /usr/local/jdk1.3.1/bin/java -verify a.TestA
Exception in thread "main" java.lang.IllegalAccessError: try to access 
class b/TestBB from class a/TestA
        at a.TestA.main(TestA.java:8)

> or kaffe (ChangeLog head: 2003-08-27  Jim Pick
> <jim at kaffe.org>), no such error occus.
[test case cut...]

Okie, I've had a look and I think its a problem with kjc and not the VM.  
In particular the code generated by kjc for the call to foo() is wrong (i 

  invokevirtual b/TestBB/foo()I

Notice that its making the call on TestBB (package-private class) and not
TestB (public class).  Code generated by jikes/javac generates the correct 
call to TestB/foo().



More information about the kaffe mailing list