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)```