Eclipse 中的 Java 7 JVM 验证错误
当我使用 JDK 7 在 eclipse indigo 中编译项目时,出现以下错误对话框
以及以下堆栈跟踪
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:-UseSplitVerifier
的解决方法,虽然它有效,但这个错误仍然让我感到困惑。
有谁知道为什么会发生这种情况以及为什么解决方法...有效?
--注意--
该项目使用 JDK 6 可以正常编译。
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?
--Note--
The project compiles fine using JDK 6.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
Bug 353467 谈到“使用
-XX:-UseSplitVerifier< /code> 激活旧验证器”。
这与 JDK TM 6 采用指南 一致,其中该选项描述为:
因此,2011-10-03 的评论确实指出了这一点:
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:
So the comment from 2011-10-03 does point out that:
当我遇到这个问题时,我通过从项目中删除 JDK 1.7 系统库并添加 1.6 JDK 库来修复它。我又去运行项目,没有报错。当我再次添加 JDK 1.7 库时,它仍然可以工作,因此“交换”中的某些内容使其可以工作。
When I had this problem, I fixed it by deleting my JDK 1.7 system libraries from the project, and added the 1.6 JDK libraries instead. I went to run the project again, and I didn't get the error. When I added the JDK 1.7 libraries in again, it still works, so something in the 'swapping' makes it work.
我在 Juno 中遇到了这个问题,但通过从此处的 4.2 更新站点安装最新的 4.2 版本解决了该问题:
http ://www.eclipse.org/ajdt/downloads/
这与 @VonC 一年前给出的相同 - 但由于更新的 AspectJ 现在已经存在(但不在最新的 Juno 存储库中,也不在附带的内容中)和Spring),现在它构成了一个答案。
但归功于@VonC。
请注意,这应该适用于 3.8 和 4.2。
I hit this problem in Juno, but resolved it by installing the latest 4.2 version from the 4.2 update site here:
http://www.eclipse.org/ajdt/downloads/
That's the same one @VonC gave a year ago -- but since the updated AspectJ is there now (but not in the latest Juno repository nor with what is shipped with Spring), it now constitutes an answer.
But credit to @VonC.
Note that this should work for 3.8 as well as 4.2.
目前,我的环境是 jdk 1.7(j2sdk 1.7 update 21) 和 eclipse 4.2 juno (SR2)
我遇到了同样的问题,所以我修复了它,配置了 VM 参数选项“-XX:-UseSplitVerifier”
但当我部署基于google-app-engine的产品时,遇到了很大的麻烦。
最后我改变了java 6(更新43)
currently, my environments is jdk 1.7(j2sdk 1.7 update 21) with eclipse 4.2 juno (SR2)
I had same problem, so I had fixed it which configured VM arguments Option '-XX:-UseSplitVerifier'
but it has ocurred big trouble when I will deploy product based on google-app-engine.
finally I changed java 6 (update 43)