I installed LibericaJDK 11 , version 11.0.5 :
B4J-Bridge version is 1.43.
Raspbian version is
I found problem on connecting PC app to Pi3 using B4J-bridge.
I ran B4J-bridge using sudo java -jar b4j-bridge.jar, and error message will be java.lang.UnsupportedOperationException: Unable to open DISPLAY
If I ran B4J-bridge without sudo, just java -jar b4j-bridge.jar, application also can not run, with the same message.
Later I read on Internet, that we can use DISPLAY=:0 java -jar b4j-bridge.jar, then this can run.
However, since I will be using GPIO, I2C and etc , i need sudo, but if I ran sudo DISPLAY=:0 java -jar b4j-bridge.jar, above error will come out.
Please advice if anybody have tried and have solution.
B4X:
openjdk version "11.0.5-BellSoft" 2019-10-15
OpenJDK Runtime Environment (build 11.0.5-BellSoft+11)
OpenJDK 32-Bit Server VM (build 11.0.5-BellSoft+11, mixed mode)
B4J-Bridge version is 1.43.
Raspbian version is
B4X:
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
I found problem on connecting PC app to Pi3 using B4J-bridge.
I ran B4J-bridge using sudo java -jar b4j-bridge.jar, and error message will be java.lang.UnsupportedOperationException: Unable to open DISPLAY
B4X:
Exception in thread "main"
java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1051)
Caused by: java.lang.UnsupportedOperationException: Unable to open DISPLAY
at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication.lambda$new$6(GtkApplication.java:173)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication.<init>(GtkApplication.java:171)
at javafx.graphics/com.sun.glass.ui.gtk.GtkPlatformFactory.createApplication(GtkPlatformFactory.java:41)
at javafx.graphics/com.sun.glass.ui.Application.run(Application.java:144)
at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:258)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:269)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:158)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:658)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:409)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:363)
... 5 more
If I ran B4J-bridge without sudo, just java -jar b4j-bridge.jar, application also can not run, with the same message.
Later I read on Internet, that we can use DISPLAY=:0 java -jar b4j-bridge.jar, then this can run.
However, since I will be using GPIO, I2C and etc , i need sudo, but if I ran sudo DISPLAY=:0 java -jar b4j-bridge.jar, above error will come out.
Please advice if anybody have tried and have solution.