### Liberica JDK Hints

Hints for developing Raspberry Pi JavaFX applications using the Liberica JDK 10 (based on the OpenJDK).
See https://www.bell-sw.com/java-for-raspberry-pi.html .
Error Message Failed to write to /sys/class/input/mice/uevent
Message
“Udev: Failed to write to /sys/class/input/mice/uevent – Check that you have permission to access input devices”
This message occurs when executing a JavaFX application on a Raspberry Pi using a user other than root, i.e. user pi.
Cause
JavaFX requires direct write access to device hardware.
Solution
Option 1:
Execute the application as sudo, i.e. sudo java -jar myjavafxapp.jar
Option 2:
Modify settings to grant write access to the devices all users that belongs to the “input” group.
Edit the 99-com.rules file:
$sudo nano /etc/udev/rules.d/99-com.rules
Add at the bottom:
SUBSYSTEM=="input*", PROGRAM="/bin/sh -c '\
chown -R root:input /sys/class/input/*/ && chmod -R 770 /sys/class/input/*/;\
'"
Run the application without root: java -jar myjavafxapp.jar
Application Close
In the B4J application, ensure to implement a close button to exit the application as the generated JavaFX application has not titlebar.
Application Test
To test the application developed on a device, i.e. Windows 10 PC, use the B4J Bridge.
On the Raspberry Pi, create a folder /home/pi/b4j.
Copy the b4j-bridge.jar to that folder and start a sudo: sudo java -jar b4j-bridge.jar
The JavaFX application runs in Full Screen on the Raspberry Pi.
When using VNC, the application is not visible - only on the monitor connected to the Raspberry Pi.

Changed: 2018-04-19 10:52, Category: Raspberry Pi UI Liberica, File: T6C287M2161.htm, ID: 2161