本文介绍了Java 7 JVM VerifyError在Eclipse中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用JDK 7编译我的项目在eclipse靛蓝,我得到以下错误对话框

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

与以下堆栈跟踪

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)

我发现了一个相关的错误,并使用建议的解决方法使用jvm选项 -XX:-UseSpli tVerifier 虽然它有效,但这个错误仍然让我感到困惑。

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?

该项目使用JDK 6进行编译。

The project compiles fine using JDK 6.

推荐答案

谈到使用 -XX:-UseSplitVerifier 激活旧的验证者。

这与,其中将该选项描述为:

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:

缺少或不正确 StackMapTable 属性为版本 50.0 类文件可能导致 VerifyError 例外。

工具重新编写版本 50.0 类文件中的字节码,并且不正确更新 StackMapTable 可能无法验证和触发异常。 p>

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.

所以指出:

这篇关于Java 7 JVM VerifyError在Eclipse中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-22 07:33