...
JavaFX on the Raspberry Pi takes over the whole screen and captures all Linux input devices. While this will generally be the behavior you want in a deployed application, it is less convenient for development because you can't stop an application using control-C unless the JavaFX application has a KeyEvent handler that listens for control-C and calls Platform.exit()
. There's nothing unusual about this - many Linux fullscreen full-screen console applications have the same behavior - but it is often useful to have a quick way to end an an application during development without changing the application code.
There are two ways to run applications with the ability to be terminated by control-C:
- Run applications over an ssh SSH connection from a PC. This gives most control over the device, because once you have ssh SSH connections set up then you can use them for other purposes as well.
- Alternatively, you can use a built-in debugging feature to trap control-C. If you set the environment variable
JAVA_DEBUG=1
before starting Java then JavaFX will exit when you press control-C. For example
...