title: jPackage - Wix - App doesn’t launch, but there are no diagnostic messages
body: <p>I have been trying to package my java javafx desktop application using jPackage on Windows.</p>
  <p>The application runs fine under Netbeans but nothing happens (no error messages) when I click the shortcut produced by the installer or by trying to run it using the command line interface.</p>
  <p>I am using java version 17.0.1 2021-10-19 LTS</p>
  <p><strong>Questions</strong></p>
  <p>I have been unable to discover what the error is. It runs quite happily in Netbeans, so I am thinking it is something with the way I have set up JPackage arguments but I can’t see what the error is. Without any diagnostic messages it is difficult to diagnose the problem.</p>
  <ol>
  <li>How can I see any messages when the app fails to launch?</li>
  <li>I am using the JavaFX modules. Should I include the javafx jar files in my class path libs folder? I am guessing I shouldn’t as I am including the modules.</li>
  <li>Should I try and run it from the console by creating a console launcher. I don’t know how yet but will investigate. I may be able to see diagnostic error and system out messages.</li>
  <li>Does the app launcher display any diagnostic messages that may help
  to diagnose the problem.</li>
  </ol>
  <p><strong>What did I do to create the App Installer</strong></p>
  <p>Before running JPackage, I created a &quot;Package&quot; directory and copied the main jar file and other application files to a &quot;config&quot; directory within it. I then defined the config directory as the input directory. The output directory to my current directory. (see jPackage command below).</p>
  <p>My packaging directory structure is therefore...</p>
  <p><a href="https://i.stack.imgur.com/snFmL.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/snFmL.jpg" alt="jPackage Directory Structure" /></a></p>
  <p>The config file contains the following:</p>
  <p><a href="https://i.stack.imgur.com/BZ8AT.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BZ8AT.jpg" alt="enter image description here" /></a></p>
  <p>The libs folder contains a list of jars such as log4j etc and under the mods folder is the javaFX 17 modules.</p>
  <p>PictureTool4-1.0.exe is the installer generated by JPackage with the following command:</p>
  <pre><code>c:\Dev\Package\PictureTool4\Package&gt;jPackage --name pictureTool4 --input config  --main-jar PictureTool4-4-0.jar  --module-path mods\javafx-jmods-17.0.1 --add-modules javafx.media,javafx.fxml,javafx.swing,javafx.controls,javafx.graphics --win-dir-chooser --win-shortcut
  </code></pre>
  <p>The Manifest file in the PictureTool4-4-0.jar contains the main class:</p>
  <pre><code>Manifest-Version: 1.0
  Archiver-Version: Plexus Archiver
  Created-By: Apache Maven 3.6.3
  Built-By: User
  Build-Jdk: 17.0.1
  Class-Path: libs/log4j-api-2.13.0.jar etc ... list of jars)
  Main-Class: omac.main.JFXPictureToolMain
  </code></pre>
  <p><strong>What else have I tried…</strong>*</p>
  <p>1 Added a system out message.</p>
  <p>Straight after the applications main...</p>
  <pre><code>    public static void main(String[] args) {
              System.out.println(&quot;PictureTool4 has started&quot;);
      launch(args);
  }
  </code></pre>
  <ol start="2">
  <li>Added a splash screen</li>
  </ol>
  <p>And added a splash screen by adding <code>--java-options &quot;-splash:\$APPDIR/PictureTool-Splash.jpg&quot;</code> to the jPackage arguments.</p>
  <p>The application didn't display a splash screen or any messages.</p>
  <p><em><strong>References</strong></em></p>
  <p>Stackoverflow.com
  <a href="https://stackoverflow.com/questions/62606900/in-java-how-do-you-debug-exe-created-by-jpackage">In Java how do you debug exe created by JPackage</a></p>
  <p><a href="https://docs.oracle.com/en/java/javase/14/jpackage/packaging-tool-user-guide.pdf" rel="nofollow noreferrer">https://docs.oracle.com/en/java/javase/14/jpackage/packaging-tool-user-guide.pdf</a></p>