Wednesday, September 24, 2014

Debugging JavaFX with Linux/X11

When debugging a JavaFX application under Linux there is the Problem of mouse grabbing, i.e. the application under test grabs the mouse and no other application can receive normal GUI events.

This of course makes debugging nearly impossible. After some research I've found a solution in the issue tracker of JavaFX: You have to set the system property (aka VM arguments) -Dglass.disableGrab=true.

Like this in eclipse:

BTW, according to the Java bug database, for AWT applications the same can be achieved by using -Dsun.awt.disablegrab=true but I haven't tried that.

Important caveat:  If you start your application this way, drag and drop will no longer work in your application.

1 comment:

  1. Fantastic -- this really saved the day for me. Now able to debug JavaFX. Thanks a lot!!

    ReplyDelete