[Solved] Code shows no errors, but crashes with a compiler error when run in IDE

The topic says it all. Here’s the stack trace:

SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
java.lang.ExceptionInInitializerError
at fps.WeaponState.setEnabled(WeaponState.java:91)
at fps.StateTerminal.startGame(StateTerminal.java:126)
at fps.ClientState$ClientMessageListener$1.call(ClientState.java:94)
at com.jme3.app.AppTask.invoke(AppTask.java:142)
at com.jme3.app.Application.runQueuedTasks(Application.java:583)
at com.jme3.app.Application.update(Application.java:596)
at com.jme3.app.SimpleApplication.update(SimpleApplication.java:231)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:151)
at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:185)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:228)
at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.RuntimeException: Uncompilable source code - fps.weapons.AutoGunWeapon is not abstract and does not override abstract method reset() in fps.weapons.Weapon
at fps.weapons.GunWeapon.<clinit>(GunWeapon.java:5)
... 11 more

So it’s telling me that my AutoGunWeapon class doesn’t override reset() from its superclass…but it does. If I Clean and Build the code, then run MyGame.jar, it works without a problem. Only trying to run in the IDE causes this problem. It’s like it’s saying it compiled but hasn’t. I’ve tried closing/reopening jMP and rebooting the computer - still nothing.

The Netbeans incremental compiler is really buggy in my opinion. These errors are 100% compiler bugs caused by the “compile on save” option for the project. Go into the project settings and turn it off and you will magically see these problems disappear.

Whenever I start a project and forget to change this setting, it’s usually less than a day or two before Netbeans reminds me about it with one of these errors.

2 Likes

I disabled compile on save, and it’s working fine now. Thanks!