[kaffe] java.lang.IllegalAccessError

Ito Kazumitsu kaz at maczuka.gcd.org
Wed Oct 22 09:20:03 PDT 2003


The attached programs cause java.lang.IllegalAccessError,
which partly seemes to have something to do with KJC,
but class files compiled with Sun's javac also cause the
error.

Compiler       Runtime VM       Result
--------       ----------       -------------------------
KJC            Kaffe            java.lang.IllegalAccessError
               JDK              OK
               JDK -verify      java.lang.IllegalAccessError

javac of JDK   Kaffe            java.lang.IllegalAccessError
               JDK              OK
               JDK -verify      OK

Kaffe: from CVS
       ChangeLog head: 2003-10-12  Jim Pick  <jim at kaffe.org>

KJC: KJC that comes with Kaffe 

JDK: Sun's JDK 1.4.2-b28

bash-2.05b$ cat a1/Base.java 
package a1;
public abstract class Base {
  protected class Base1 {
    public Base1() {}
  }
}

bash-2.05b$ cat a1/a2/Extend.java 
package a1.a2;
import a1.Base;
final class Extend extends Base {
  public static void main(String[] args) {
    new Extend().foo();
  }
  private void foo() {
    Base1 b = new Base1();
  }
}

bash-2.05b$ kaffe a1.a2.Extend
java.lang.IllegalAccessError: a1/Base$Base1.<init>
   at a1.a2.Extend.foo (Extend.java:8)
   at a1.a2.Extend.main (Extend.java:5)




More information about the kaffe mailing list