I am attempting to use JavaFX on Linux Mint 22.2. I have followed the JavaFX getting started instructions for both 'Run HelloWorld Using JavaFX' and 'JavaFX and Visual Studio Code -> Non-modular from IDE'. I modified the getting started program to not use FXML. The program compiles and runs in VSCode, but with the following command line:
java --module-path /home/jim/Downloads/javafx-sdk-25/lib --add-modules javafx.controls --enable-native-access=javafx.graphics BuilderGUI.java I get:
Exception in thread "main" java.lang.UnsupportedOperationException: Unable to load glass GTK library.
Here is the program source code:
public class BuilderGUI extends Application { @Override public void start(Stage stage) throws Exception { StackPane pane = new StackPane(); pane.getChildren().add(new Label("Hello, FlexiShow Builder!")); Scene scene = new Scene(pane, 400, 300); stage.setScene(scene); stage.setTitle("FlexiShow Builder"); stage.show(); } public static void main(String[] args) { launch(args); } } and here is the contents of the launch.json file:
{ // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.1.0", "configurations": [ { "type": "java", "name": "Launch App", "request": "launch", "mainClass": "flexishowbuilder.BuilderGUI", "vmArgs": "--module-path /home/jim/Downloads/javafx-sdk-25/lib --add-modules javafx.controls --enable-native-access=javafx.graphics", } ] } Yes I have set the PATH_TO_FX environment variable. Otherwise the program would not compile either on the command line or in VSCode.
java --version gives:
openjdk 25 2025-09-16 OpenJDK Runtime Environment (build 25+36-snap) OpenJDK 64-Bit Server VM (build 25+36-snap, mixed mode, sharing)
and JavaFX version is 25.
How to I get rid of the exception so I can run the program at the command line?