When I compile my project in eclipse indigo using JDK 7, I get the following error dialog
with the following stacktrace
Exception in thread "main" java.lang.VerifyError: Expecting a stackmap frame at branch target 32 in method ... at offset 0
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.getMethod0(Unknown Source)
at java.lang.Class.getMethod(Unknown Source)
at sun.launcher.LauncherHelper.getMainMethod(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
I've found a relevant bug here and used the suggested workaround of using jvm option -XX:-UseSplitVerifier
and although it works, this bug still confuses me.
Does anyone know why this is happening and why the workaround...works?
The project compiles fine using JDK 6.
Bug 353467 speaks about "using -XX:-UseSplitVerifier
to activate the old verifier".
That is consistent with the JDK TM 6 Adoption Guide which describes that option as:
Traditional verifier can be forced with the
-XX:-UseSplitVerifier
flag.Missing or incorrect
StackMapTable
attributes for version50.0
class files can result inVerifyError
exceptions.
Tools that rewrite bytecode in version50.0
class files and do not correctly update theStackMapTable
may fail to verify and trigger exceptions.
So the comment from 2011-10-03 does point out that:
AspectJ now auto activates the previously optional setting to create stackmaps if the classes are Java7.