Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java 7 JVM VerifyError in Eclipse

When I compile my project in eclipse indigo using JDK 7, I get the following error dialog

enter image description here

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?

--Note--

The project compiles fine using JDK 6.

like image 529
mre Avatar asked Nov 01 '11 17:11

mre


1 Answers

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 version 50.0 class files can result in VerifyError exceptions.
Tools that rewrite bytecode in version 50.0 class files and do not correctly update the StackMapTable 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.

like image 121
VonC Avatar answered Sep 28 '22 00:09

VonC