2

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.

Colonnello
  • 21
  • 3
  • 1
    Try uninstalling the old version via Settings -> Apps. If that fixes your problem is it a duplicate of [Cannot rerun Java JPackage installer if already installed, second time just exits without warning](https://stackoverflow.com/questions/62675323/cannot-rerun-java-jpackage-installer-if-already-installed-second-time-just-exit) – DuncG Jan 24 '22 at 12:34
  • 1
    The titles of both this and the referenced question do not really specify the issue. Expect more duplicates to show up. – Queeg Jan 26 '22 at 12:31
  • Should I change the title to something more accurate now that the problem is solved? Removing the installation folder wasn't clearly enough to remove the software from Windows, still the installer doesn't give any tips about why it crashes immediately after launch. – Colonnello Jan 26 '22 at 13:58

0 Answers0