Solution # 1 - Enable the Java console and look for exceptions.
You can do this through the Java control panel. Click the Advanced tab, and in the Java console, make sure Show Console is selected.
Then run the application and check the console for exceptions. Correct the exception.
Solution # 2 - Debugging a running application (correctly).
Launch the Web Launch application (for Java 1.6 and later):
javaws -verbose -J-Xdebug -J-Xnoagent -J-Xrunjdwp:transport=dt_socket,server=n,suspend=y,address=8123 http://myserver.com/path/to/myapp.jnlp
If using earlier versions of java (1.4.2, 1.5) sets an environment variable, for example:
set JAVAWS_VM_ARGS="-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=n,suspend=y,address=8123"
and run the application through:
javaws http://myserver.com/path/to/myapp.jnlp
When the application starts:
- Attach the debugger (Eclipse does - use Run => Debug Configurations => Remote Java Application, and in the Connection Properties panel, enter the port passed in the parameters in
javaws (in this case: 8123 ). - Set a breakpoint inside your
windowClosing method. - Try closing the application - Eclipse should break execution at breakpoint
- Insert the
GameLoop.INSTANCE.stopLoop() method to see where / when it hangs.
Do not expect to see solutions on the console, just execute the code using the debugger - if the application freezes, it will show you where.
npe
source share