What does IncompatibleClassChangeError signify?

Millies, Sebastian Sebastian.Millies at softwareag.com
Wed Sep 25 01:41:44 PDT 2013

Hello there,

This is with b106 under Windows. I have compiled some classes (no error) and then run one of them. At runtime I get:

Exception in thread "main" java.lang.IncompatibleClassChangeError: Class java8.monads.MaybeDemo$$Lambda$1 does not implement the requested interface java8.monads.Monad
at java8.monads.Monad.lambda$94(Monad.java:50)
            at java8.monads.Monad$$Lambda$3.apply(Unknown Source)
            at java8.monads.MaybeMonad.bind(MaybeMonad.java:23)
            at java8.monads.Monad.lambda$93(Monad.java:50)
            at java8.monads.MaybeMonad.lambda$93(MaybeMonad.java)
            at java8.monads.Monad$$Lambda$2.apply(Unknown Source)
            at java8.monads.MaybeMonad.bind(MaybeMonad.java:23)
            at java8.monads.Monad.ap(Monad.java:51)
            at java8.monads.MaybeMonad.ap(MaybeMonad.java)
            at java8.monads.MaybeDemo.main(MaybeDemo.java:35)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
            at java.lang.reflect.Method.invoke(Method.java:491)
            at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)

Now,  the code is likely very wrong, contains unchecked and perhaps illegal casts, erroneous type parameters etc. However, I'd have expected ClassCastException, NoSuchMethodError, ClassNotFoundException, whatever, but not a subclass of LinkageError. After all, how *could* any classes have changed? Why should re-linkage happen at all? No class has dependencies outside the JDK. Does something strange happen under the hood? Under what circumstances should I expect IncompatibleClassChangeError when using lambdas?


Software AG - Sitz/Registered office: Uhlandstra?e 12, 64297 Darmstadt, Germany - Registergericht/Commercial register: Darmstadt HRB 1562 - Vorstand/Management Board: Karl-Heinz Streibich (Vorsitzender/Chairman), Dr. Wolfram Jost, Arnd Zinnhardt; - Aufsichtsratsvorsitzender/Chairman of the Supervisory Board: Dr. Andreas Bereczky - http://www.softwareag.com

More information about the lambda-dev mailing list