[kaffe] gcj-3.3.2 + Kaffe CVS: java.lang.IllegalAccessError

Everton da Silva Marques everton@lab.ipaccess.diveo.net.br
Wed Nov 12 11:38:02 2003


Hi,

I'm getting the following IllegalAccessError:

$ /usr/local/kaffe/bin/java -classpath . Main
java.lang.IllegalAccessError: a/B.m
   at Main.main (Main.java:7)
$

But only when I compile my code with gcj into
bytecode and run under Kaffe. The table below
summarizes the tests.

gcj:   3.3.2
kaffe: CVS (ChangeLog head: 2003-11-12 Ito Kazumitsu <kaz@maczuka.gcd.org>)
jdk:   j2sdk1.4.2_02

compiler VM    result
---------------------------------
gcj      j2sdk ok
gcj      kaffe IllegalAccessError
j2sdk    j2sdk ok
j2sdk    kaffe ok

This is a source code sample to reproduce the issue:

// a/A.java
package a;
abstract class A {
}

// a/B.java
package a;
abstract class B {
    public void m() {
        System.out.println("B.m()");
    }
}

// a/C.java
package a;
public class C extends B {
}

// Main.java
import a.C;
public class Main {
    public static void main(String args[]) {
        C obj = new C();
        obj.m();
    }
}

Thanks,
Everton