I'm trying to build an executable file for deployment of a Java desktop application using jdk 17 and JavaFX.
I'm using jpackage following oracle docs guide with basic command:
jpackage --name MyApp --input target --main-jar MyApp.jar
And the first time it worked as expected. From the second time, when i tried to use --app-image with a custom JRE or using:
jpackage --name MyApp --input target --main-jar MyApp.jar --module-path {path_name}/javafx-jmods-17.0.2 --add-modules javafx.base,javafx.controls,javafx.fxml
the installer is built correctly but when i run it a window pop up and then immediately close with a Windows sound and nothing else happens, with the process of the installer still in background.
I already checked this question and related: jpackage creates an installer that hangs but in my case there isn't any MyApp already installed. I also tried again using only the first command line without adding javafx modules but the problem now persists.