Invoking a default method can cause IllegalAccessError

Stephan Herrmann stephan.herrmann at
Sun Mar 31 06:36:58 PDT 2013

Compile these 2 files using

----8<--- p2/ ---8<----

package p2;
interface I {
     public default void foo() {
public interface J extends I {}

----8<--- p1/ ---8<----

package p1;
public class C implements p2.J {
     public static void main(String[] args) {
         C c = new C();;


Running p1.C yields:

Exception in thread "main" java.lang.IllegalAccessError: tried to access 
class p2.I from class p1.C
         at p1.C.main(

Obviously javac forgot to generate a synthetic super access
into J (not expecting that interfaces ever need such, but ..)


More information about the lambda-dev mailing list