简体   繁体   English

如何解决此验证错误?

[英]How can I fix this Verify Error?

I have recently been struggling to find the source a fatal error message that my program keeps showing: 我最近一直在努力寻找源,但我的程序不断显示的致命错误消息:

Exception in thread "main" java.lang.VerifyError: Inconsistent stackmap frames at branch target 65

I've tried many things already, including: deleting all of the class files and rebuilding them, copying the entire project into a new project, upgrading my version of Eclipse (from Kepler to Luna), and modifying the code around where the line number that the error message gives. 我已经尝试了很多事情,包括:删除所有的类文件并重建它们,将整个项目复制到一个新项目中,升级我的Eclipse版本(从Kepler到Luna),以及在行号附近修改代码。错误消息给出的信息。 Nothing has worked, and I've ruled out the editor as other java projects run just fine. 没有任何工作,我已经排除了编辑器,因为其他java项目运行得很好。 I would greatly appreciate it if you would let me know a way to solve this. 如果您能让我知道解决此问题的方法,我将不胜感激。

My code can be found here . 我的代码可以在这里找到。 The error has something to do with the Chunk class but what it is specifically I honestly do not know. 该错误与Chunk类有关,但是老实说我不知道​​具体是什么。 The stack trace of the error message is: 错误消息的堆栈跟踪为:

at ca.ajweeks.igmc2014.level.Level.<init>(Level.java:22)
at ca.ajweeks.igmc2014.state.GameState.init(GameState.java:36)
at ca.ajweeks.igmc2014.state.StateManager.init(StateManager.java:34)
at ca.ajweeks.igmc2014.state.StateManager.<init>(StateManager.java:29)
at ca.ajweeks.igmc2014.Game.<init>(Game.java:38)
at ca.ajweeks.igmc2014.Game.main(Game.java:51)

EDIT: The source of the error seems to have been a pesky try-with-resources statement in the readFile method in the Chunk Class. 编辑:错误的来源似乎是在Chunk类的readFile方法中令人讨厌的try-with-resources语句。 I don't know if there is a bug in the current version of java that was causing this, or something to do with my specific program, either way using a normal try-catch block does the trick. 我不知道在当前版本的Java中是否有导致此错误的漏洞,或者与我的特定程序有关的漏洞,无论是使用常规try-catch块的方式都可以解决问题。 Thanks everyone for the help! 谢谢大家的帮助!

If you would post relevant code here, that would save a lot of time along with the link to your code. 如果您要在此处发布相关代码,则可以节省大量时间以及代码链接。

have a look at this thread Here A similar error and its solution, hope this helps. 看看这个线程, 这里有一个类似的错误及其解决方法,希望能对您有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM