1

I built the .exe file by Jpackage and WIX on Windows10(JDK17,JavaFX17).Then it shows "Child process exited with code 1"

enter image description here

this is my Jpackage command: jpackage --name test --input target --main-jar mechanical-1.0-SNAPSHOT.jar --icon src/main/resources/images/logo.ico --vendor J --win-dir-chooser --win-shortcut --win-menu-group "test" --win-menu

I can't find any log or other information.

vimuth
  • 5,064
  • 33
  • 79
  • 116
HawkinHu
  • 21
  • 4
  • Does the `--verbose` command line option provide any more useful information? – jewelsea Mar 24 '23 at 09:25
  • 1
    If it's the executable built by `jpackage` that's failing, see if adding `--win-console` to the `jpackage` command and then running the resulting executable from the terminal provides any insights (e.g., an error/stack trace, which if one does appear, then you should [edit] your question to add it). – Slaw Mar 24 '23 at 15:49

2 Answers2

1

non-zero exit means the process failed.

Sometimes a specific code can provide some insight into the reason for failure. In this case it does not.

See: What "standard" application return/exit codes should an application support?

You probably want more information on why the jpackage process failed. However, given the information already provided in your question, there is no additional information which can be provided here.

jewelsea
  • 150,031
  • 14
  • 366
  • 406
  • 1
    Wait, is it `jpackage` that's failing, or the executable built by `jpackage` that's failing? – Slaw Mar 24 '23 at 15:48
  • The message says a child process failed, so it could be a spawned process as part of the packaging, such as Wix. There is still not enough info to diagnose and fix the issue though. – jewelsea Mar 24 '23 at 18:02
  • Thank you all! I've got the solution and answered it. – HawkinHu Mar 27 '23 at 01:45
  • I see now @Slaw you were correct. Based on the info in the accepted self-answer, this was an error that occurred during execution of the packaged application and not during the packaging of the application. – jewelsea Mar 27 '23 at 06:00
1

The real problem is that i can't get useful information about the error. So we can add --win-console to jpackage command and rebuild.Then the terminal will provide error trace.

HawkinHu
  • 21
  • 4
  • Another approach is to add logging to your application and configure the framework to log to a file. Depending on when exactly the application fails, that will cause the error to be logged to the file so you can see it without having to deal with `--win-console`. Of course, assuming you actually log the error. – Slaw Mar 28 '23 at 03:14
  • @Slaw Yes,thank you for your notice! A log file is necessary. – HawkinHu Mar 29 '23 at 04:08