How can I fix this Verify Error?

731 views Asked by At

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. Nothing has worked, and I've ruled out the editor as other java projects run just fine. 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. 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. 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. Thanks everyone for the help!

1

There are 1 answers

0
SonalKhodiyar On

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.