Problem description:
I am trying to launch a JavaFX repl, and it is crashing. I have given my students an assignment using JavaFX, and this is causing no little distress, so an explanation of what’s going on would be hugely appreciated!
Expected behavior:
The output window to open
Actual behavior:
I get this instead:
sh -c javac --module-path javafx-sdk-18.0.2/lib --add-modules javafx.controls Main.java
java --module-path javafx-sdk-18.0.2/lib --add-modules javafx.controls Main
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:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:1082)
Caused by: java.lang.UnsupportedOperationException: Unable to open DISPLAY
at javafx.graphics@18.0.2/com.sun.glass.ui.gtk.GtkApplication.lambda$new$6(GtkApplication.java:202)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
at javafx.graphics@18.0.2/com.sun.glass.ui.gtk.GtkApplication.<init>(GtkApplication.java:200)
at javafx.graphics@18.0.2/com.sun.glass.ui.gtk.GtkPlatformFactory.createApplication(GtkPlatformFactory.java:41)
at javafx.graphics@18.0.2/com.sun.glass.ui.Application.run(Application.java:146)
at javafx.graphics@18.0.2/com.sun.javafx.tk.quantum.QuantumToolkit.startup(QuantumToolkit.java:290)
at javafx.graphics@18.0.2/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:293)
at javafx.graphics@18.0.2/com.sun.javafx.application.PlatformImpl.startup(PlatformImpl.java:163)
at javafx.graphics@18.0.2/com.sun.javafx.application.LauncherImpl.startToolkit(LauncherImpl.java:659)
at javafx.graphics@18.0.2/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:410)
at javafx.graphics@18.0.2/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:364)
... 5 more
Steps to reproduce:
Create a new JavaFX replit
Click on Run
Bug appears at this link:
Browser/OS/Device: