openjfx16ea在pi3上抛出libprism\u es2\u monocle.so的不满意链接错误:libglesv2.so

iqih9akk  于 2021-06-30  发布在  Java
关注(0)|答案(2)|浏览(403)

我尝试在raspberry PI3B+上使用javafx应用程序,并将一个小的显示器连接到显示端口。但这会在启动应用程序时引发错误。
也许首先要问几个问题:
javafx是否支持显示端口?因为这是我第一次用它代替hdmi。
或者openjfx16ea只适用于树莓pi 4?
我从下载了最新的openjfxhttps://gluonhq.com/products/javafx/.
这是我运行(maven)编译的应用程序的启动命令:

sudo java -Dmonocle.egl.lib=/opt/arm32fb-sdk/lib/libgluon_drm.so \
  -Djava.library.path=/opt/arm32fb-sdk/lib \
  -Dmonocle.platform.traceConfig=true \
  -Dmonocle.platform=EGL \
  -Dprism.verbose=true \
  -Djavafx.verbose=true \
  -p /opt/arm32fb-sdk/lib \
  --add-modules javafx.controls \
  -jar javafx-ui-1.0.0-SNAPSHOT-jar-with-dependencies.jar

这是错误输出:

$ bash start_on_raspberrypi.sh
JavaFX launchApplication method: launchMode=LM_JAR
Prism pipeline init order: es2 sw
Using Double Precision Marlin Rasterizer
Using dirty region optimizations
Using system sized mask for primitives
Not forcing power of 2 sizes for textures
Using hardware CLAMP_TO_ZERO mode
Opting in for HiDPI pixel scaling
Prism pipeline name = com.sun.prism.es2.ES2Pipeline
Loading ES2 native library ... prism_es2_monocle
WARNING: java.lang.UnsatisfiedLinkError: /opt/arm32fb-sdk/lib/libprism_es2_monocle.so: libGLESv2.so.2: cannot open shared object file: No such file or directory
GraphicsPipeline.createPipeline failed for com.sun.prism.es2.ES2Pipeline
java.lang.UnsatisfiedLinkError: /opt/arm32fb-sdk/lib/libprism_es2_monocle.so: libGLESv2.so.2: cannot open shared object file: No such file or directory
        at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
        at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2442)
        at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2498)
        at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2694)
        at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2659)
        at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:830)
        at java.base/java.lang.System.loadLibrary(System.java:1873)
        at javafx.graphics/com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:163)
        at javafx.graphics/com.sun.glass.utils.NativeLibLoader.loadLibrary(NativeLibLoader.java:53)
        at javafx.graphics/com.sun.prism.es2.ES2Pipeline.lambda$static$0(ES2Pipeline.java:69)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at javafx.graphics/com.sun.prism.es2.ES2Pipeline.<clinit>(ES2Pipeline.java:51)
        at java.base/java.lang.Class.forName0(Native Method)
        at java.base/java.lang.Class.forName(Class.java:315)
        at javafx.graphics/com.sun.prism.GraphicsPipeline.createPipeline(GraphicsPipeline.java:218)
        at javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.init(QuantumRenderer.java:91)
        at javafx.graphics/com.sun.javafx.tk.quantum.QuantumRenderer$PipelineRunnable.run(QuantumRenderer.java:124)
        at java.base/java.lang.Thread.run(Thread.java:834)

***Fallback to Prism SW pipeline

Prism pipeline name = com.sun.prism.sw.SWPipeline
Loaded /opt/arm32fb-sdk/lib/./libprism_sw.so from relative path
(X) Got class = class com.sun.prism.sw.SWPipeline
Initialized prism pipeline: com.sun.prism.sw.SWPipeline
JavaFX: using com.sun.javafx.tk.quantum.QuantumToolkit
traceConfig: Trying platform EGL with class com.sun.glass.ui.monocle.EGLPlatformFactory
WARNING: java.lang.UnsatisfiedLinkError: /opt/arm32fb-sdk/lib/libglass_monocle.so: libgbm.so.1: cannot open shared object file: No such file or directory
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.RuntimeException: java.lang.UnsatisfiedLinkError: /opt/arm32fb-sdk/lib/libglass_monocle.so: libgbm.so.1: cannot open shared object file: No such file or directory
        at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:290)
        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
Caused by: java.lang.UnsatisfiedLinkError: /opt/arm32fb-sdk/lib/libglass_monocle.so: libgbm.so.1: cannot open shared object file: No such file or directory
        at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
        at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2442)
        at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2498)
        at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2694)
        at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2659)
        at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:830)
        at java.base/java.lang.System.loadLibrary(System.java:1873)
        at javafx.graphics/com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:163)
        at javafx.graphics/com.sun.glass.utils.NativeLibLoader.loadLibrary(NativeLibLoader.java:53)
        at javafx.graphics/com.sun.glass.ui.monocle.LinuxSystem.loadLibrary(LinuxSystem.java:76)
        at javafx.graphics/com.sun.glass.ui.monocle.LinuxPlatform.<init>(LinuxPlatform.java:32)
        at javafx.graphics/com.sun.glass.ui.monocle.EGLPlatform.<init>(EGLPlatform.java:34)
        at javafx.graphics/com.sun.glass.ui.monocle.EGLPlatformFactory.createNativePlatform(EGLPlatformFactory.java:46)
        at javafx.graphics/com.sun.glass.ui.monocle.NativePlatformFactory.getNativePlatform(NativePlatformFactory.java:112)
        at javafx.graphics/com.sun.glass.ui.monocle.MonocleApplication.<init>(MonocleApplication.java:49)
        at javafx.graphics/com.sun.glass.ui.monocle.MonoclePlatformFactory.createApplication(MonoclePlatformFactory.java:42)
        at javafx.graphics/com.sun.glass.ui.Application.run(Application.java:144)
        at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:280)
92vpleto

92vpleto1#

我好像有两个问题:
我从没有桌面的raspberry lite操作系统开始,所以首先必须安装x11

$ sudo apt install xserver-xorg
$ sudo apt install raspberrypi-ui-mods
$ sudo apt install lightdm
$ sudo reboot

2-对于覆盆子pi 3,不应使用单片眼镜,而应使用gtk。此开始脚本工作:

sudo java \
  -Dglass.platform=gtk \
  -Dprism.verbose=true \
  -Djavafx.verbose=true \
  -p /opt/arm32fb-sdk/lib \
  --add-modules javafx.controls \
  -jar javafx-ui-1.0.0-SNAPSHOT-jar-with-dependencies.jar
wztqucjr

wztqucjr2#

javafx的16个ea版本也应该可以在pi3(以及其他一些基于arm的系统)上使用。但是,您必须使用的单片眼镜平台取决于系统上安装的驱动程序。如果您选择带有drm库的egl平台,您的系统需要具有所需的库(例如libgbm.so),这些库与pi4和最新的raspberry pi os一起预装。
如果您使用的是窗口管理器,则不应使用monocle,但gtk:
-dglass.platform=gtk

相关问题