在远程桌面上使用Javafx,而无需显示
我目前正在本地桌面上构建Javafx,并且将所有渲染图表保存为快照并保存它们。现在,我需要在没有UI和显示的远程云桌面上运行我的Javafx程序。因此,现在我遇到了此错误:引起:Java.lang.unsupportedoperationException:无法打开显示。
有没有办法解决这个问题,我仍然可以在远程云桌面上没有显示的情况下获取快照吗?
我尝试添加-dglass.platform = monocle -dmonocle.platform = headless -dprism.order = sw在我的远程桌面上运行时,但是错误消息是相同的。我是否需要安装或添加任何依赖性单镜工作?
错误信息:
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[java] at java.lang.reflect.Method.invoke(Method.java:498)
[java] at sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:873)
[java] Caused by: java.lang.UnsupportedOperationException: Unable to open DISPLAY
[java] at com.sun.glass.ui.gtk.GtkApplication.lambda$new$5(GtkApplication.java:142)
[java] at java.security.AccessController.doPrivileged(Native Method)
[java] at com.sun.glass.ui.gtk.GtkApplication.<init>(GtkApplication.java:140)
[java] at com.sun.glass.ui.gtk.GtkPlatformFactory.createApplication(GtkPlatformFactory.java:41)
[java] at com.sun.glass.ui.Application.run(Application.java:146)
[java] at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:257)
[java] at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:211)
[java] at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:675)
[java] at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:337)
[java] at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)```
I'm currently building javafx on my local desktop, and I save all rendered charts as snapshot and save them. Now I'm need to run my javafx program on remote cloud desktop that does not have UI and display. So now I'm encountering this error: Caused by: java.lang.UnsupportedOperationException: Unable to open DISPLAY.
Is there a way around this, can I still get the snapshot without having a display on my remote cloud desktop?
I tried adding -Dglass.platform=Monocle -Dmonocle.platform=Headless -Dprism.order=sw when running on my remote desktop, but the error message is the same. Do I need to install or add any dependency for Monocle to work?
Error message:
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[java] at java.lang.reflect.Method.invoke(Method.java:498)
[java] at sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:873)
[java] Caused by: java.lang.UnsupportedOperationException: Unable to open DISPLAY
[java] at com.sun.glass.ui.gtk.GtkApplication.lambda$new$5(GtkApplication.java:142)
[java] at java.security.AccessController.doPrivileged(Native Method)
[java] at com.sun.glass.ui.gtk.GtkApplication.<init>(GtkApplication.java:140)
[java] at com.sun.glass.ui.gtk.GtkPlatformFactory.createApplication(GtkPlatformFactory.java:41)
[java] at com.sun.glass.ui.Application.run(Application.java:146)
[java] at com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:257)
[java] at com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:211)
[java] at com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:675)
[java] at com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:337)
[java] at com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:328)```
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论