when you double-click your .jar file, the configuration settings from your IDE—like the module path and the additional modules (e.g., javafx.controls, javafx.fxml)—aren't applied. This is why even if your IDE runs the project perfectly (since it automatically includes these settings), the standalone jar doesn't know where to find the JavaFX runtime components, leading to the error:
"Error: JavaFX runtime components are missing, and are required to run this application"
To resolve this, you have a couple of options:
Run your jar from the command line with the necessary options, for example:
java --module-path /path/to/javafx-sdk/lib --add-modules javafx.controls,javafx.fxml -jar YourApp.jar
Create an artifact that includes the JavaFX modules—such as a fat jar or a custom runtime image using jlink—so that all required components are packaged within the jar itself.
This way, your application will work as expected even when double-clicking the jar file.