title: How to create an .exe file with Launch4j and Maven
body: <p>I'm trying to create the .exe version of a project but I keep getting an error. I have minimal experience with Maven and I've never tried this. I've alredy created the .jar file and that's 100% working.</p>
  
  <p>Here is my <code>pom.xml</code> file:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
      &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
  
      &lt;groupId&gt;org.project1616&lt;/groupId&gt;
      &lt;artifactId&gt;Project16x16&lt;/artifactId&gt;
      &lt;version&gt;1.0.0&lt;/version&gt;
  
      &lt;name&gt;Project16x16&lt;/name&gt;
      &lt;!-- FIXME change it to the project's website --&gt;
      &lt;url&gt;http://www.example.com&lt;/url&gt;
  
      &lt;properties&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
          &lt;maven.compiler.source&gt;1.8&lt;/maven.compiler.source&gt;
          &lt;maven.compiler.target&gt;1.8&lt;/maven.compiler.target&gt;
      &lt;/properties&gt;
  
      &lt;repositories&gt;
          &lt;repository&gt;
              &lt;id&gt;repo&lt;/id&gt;
              &lt;releases&gt;
                  &lt;enabled&gt;true&lt;/enabled&gt;
                  &lt;checksumPolicy&gt;ignore&lt;/checksumPolicy&gt;
              &lt;/releases&gt;
              &lt;snapshots&gt;
                  &lt;enabled&gt;false&lt;/enabled&gt;
              &lt;/snapshots&gt;
              &lt;url&gt;file://${project.basedir}/repo&lt;/url&gt;
          &lt;/repository&gt;
      &lt;/repositories&gt;
  
      &lt;dependencies&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;junit&lt;/groupId&gt;
              &lt;artifactId&gt;junit&lt;/artifactId&gt;
              &lt;version&gt;4.11&lt;/version&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;local&lt;/groupId&gt;
              &lt;artifactId&gt;core&lt;/artifactId&gt;
              &lt;version&gt;1.0&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;local&lt;/groupId&gt;
              &lt;artifactId&gt;DM&lt;/artifactId&gt;
              &lt;version&gt;1.0&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;local&lt;/groupId&gt;
              &lt;artifactId&gt;gicentreUtils&lt;/artifactId&gt;
              &lt;version&gt;1.0&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;local&lt;/groupId&gt;
              &lt;artifactId&gt;javafx-swt&lt;/artifactId&gt;
              &lt;version&gt;1.0&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;local&lt;/groupId&gt;
              &lt;artifactId&gt;javafx.base&lt;/artifactId&gt;
              &lt;version&gt;1.0&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;local&lt;/groupId&gt;
              &lt;artifactId&gt;javafx.controls&lt;/artifactId&gt;
              &lt;version&gt;1.0&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;local&lt;/groupId&gt;
              &lt;artifactId&gt;javafx.fxml&lt;/artifactId&gt;
              &lt;version&gt;1.0&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;local&lt;/groupId&gt;
              &lt;artifactId&gt;javafx.graphics&lt;/artifactId&gt;
              &lt;version&gt;1.0&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;local&lt;/groupId&gt;
              &lt;artifactId&gt;javafx.media&lt;/artifactId&gt;
              &lt;version&gt;1.0&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;local&lt;/groupId&gt;
              &lt;artifactId&gt;javafx.swing&lt;/artifactId&gt;
              &lt;version&gt;1.0&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;local&lt;/groupId&gt;
              &lt;artifactId&gt;javafx.web&lt;/artifactId&gt;
              &lt;version&gt;1.0&lt;/version&gt;
          &lt;/dependency&gt;
          &lt;dependency&gt;
              &lt;groupId&gt;org.openjfx&lt;/groupId&gt;
              &lt;artifactId&gt;javafx&lt;/artifactId&gt;
              &lt;version&gt;13&lt;/version&gt;
              &lt;type&gt;pom&lt;/type&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
      &lt;build&gt;
          &lt;pluginManagement&gt;&lt;!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) --&gt;
              &lt;plugins&gt;
                  &lt;plugin&gt;
                      &lt;artifactId&gt;maven-clean-plugin&lt;/artifactId&gt;
                      &lt;version&gt;3.1.0&lt;/version&gt;
                      &lt;executions&gt;
                          &lt;execution&gt;
                              &lt;phase&gt;none&lt;/phase&gt;
                          &lt;/execution&gt;
                      &lt;/executions&gt;
                  &lt;/plugin&gt;
                  &lt;plugin&gt;
                      &lt;artifactId&gt;maven-resources-plugin&lt;/artifactId&gt;
                      &lt;version&gt;3.0.2&lt;/version&gt;
                      &lt;executions&gt;
                          &lt;execution&gt;
                              &lt;phase&gt;none&lt;/phase&gt;
                          &lt;/execution&gt;
                      &lt;/executions&gt;
                  &lt;/plugin&gt;
                  &lt;plugin&gt;
                      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                      &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                      &lt;version&gt;3.8.0&lt;/version&gt;
                      &lt;executions&gt;
                          &lt;execution&gt;
                              &lt;phase&gt;none&lt;/phase&gt;
                          &lt;/execution&gt;
                      &lt;/executions&gt;
                  &lt;/plugin&gt;
                  &lt;plugin&gt;
                      &lt;artifactId&gt;maven-surefire-plugin&lt;/artifactId&gt;
                      &lt;version&gt;2.22.1&lt;/version&gt;
                      &lt;executions&gt;
                          &lt;execution&gt;
                              &lt;phase&gt;none&lt;/phase&gt;
                          &lt;/execution&gt;
                      &lt;/executions&gt;
                  &lt;/plugin&gt;
                  &lt;plugin&gt;
                      &lt;artifactId&gt;maven-jar-plugin&lt;/artifactId&gt;
                      &lt;version&gt;3.0.2&lt;/version&gt;
                      &lt;executions&gt;
                          &lt;execution&gt;
                              &lt;phase&gt;none&lt;/phase&gt;
                          &lt;/execution&gt;
                      &lt;/executions&gt;
                  &lt;/plugin&gt;
                  &lt;plugin&gt;
                      &lt;artifactId&gt;maven-install-plugin&lt;/artifactId&gt;
                      &lt;version&gt;2.5.2&lt;/version&gt;
                      &lt;executions&gt;
                          &lt;execution&gt;
                              &lt;phase&gt;none&lt;/phase&gt;
                          &lt;/execution&gt;
                      &lt;/executions&gt;
                  &lt;/plugin&gt;
                  &lt;plugin&gt;
                      &lt;artifactId&gt;maven-deploy-plugin&lt;/artifactId&gt;
                      &lt;version&gt;2.8.2&lt;/version&gt;
                      &lt;executions&gt;
                          &lt;execution&gt;
                              &lt;phase&gt;none&lt;/phase&gt;
                          &lt;/execution&gt;
                      &lt;/executions&gt;
                  &lt;/plugin&gt;
                  &lt;plugin&gt;
                      &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt;
                      &lt;configuration&gt;
                          &lt;archive&gt;
                              &lt;manifest&gt;
                                  &lt;mainClass&gt;org.project16x16.sidescroller.SideScroller&lt;/mainClass&gt;
                              &lt;/manifest&gt;
                          &lt;/archive&gt;
                          &lt;descriptorRefs&gt;
                              &lt;descriptorRef&gt;jar-with-dependencies&lt;/descriptorRef&gt;
                          &lt;/descriptorRefs&gt;
                      &lt;/configuration&gt;
                  &lt;/plugin&gt;
                  &lt;plugin&gt;
                      &lt;artifactId&gt;maven-site-plugin&lt;/artifactId&gt;
                      &lt;version&gt;3.7.1&lt;/version&gt;
                      &lt;executions&gt;
                          &lt;execution&gt;
                              &lt;phase&gt;none&lt;/phase&gt;
                          &lt;/execution&gt;
                      &lt;/executions&gt;
                  &lt;/plugin&gt;
                  &lt;plugin&gt;
                      &lt;artifactId&gt;maven-project-info-reports-plugin&lt;/artifactId&gt;
                      &lt;version&gt;3.0.0&lt;/version&gt;
                      &lt;executions&gt;
                          &lt;execution&gt;
                              &lt;phase&gt;none&lt;/phase&gt;
                          &lt;/execution&gt;
                      &lt;/executions&gt;
                  &lt;/plugin&gt;
                  &lt;plugin&gt;
                      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
                      &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;
                      &lt;version&gt;3.1&lt;/version&gt;
                      &lt;configuration&gt;
                          &lt;source&gt;1.8&lt;/source&gt;
                          &lt;target&gt;1.8&lt;/target&gt;
                      &lt;/configuration&gt;
                      &lt;executions&gt;
                          &lt;execution&gt;
                              &lt;phase&gt;none&lt;/phase&gt;
                          &lt;/execution&gt;
                      &lt;/executions&gt;
                  &lt;/plugin&gt;
                  &lt;plugin&gt;
                      &lt;groupId&gt;com.akathist.maven.plugins.launch4j&lt;/groupId&gt;
                      &lt;artifactId&gt;launch4j-maven-plugin&lt;/artifactId&gt;
                      &lt;executions&gt;
                          &lt;execution&gt;
                              &lt;id&gt;l4j-clui&lt;/id&gt;
                              &lt;phase&gt;package&lt;/phase&gt;
                              &lt;goals&gt;
                                  &lt;goal&gt;launch4j&lt;/goal&gt;
                              &lt;/goals&gt;
                              &lt;configuration&gt;
                                  &lt;headerType&gt;gui&lt;/headerType&gt;
                                  &lt;jar&gt;target/Project16x16-1.0.0.jar.jar&lt;/jar&gt;
                                  &lt;outfile&gt;target/Project16x16.exe&lt;/outfile&gt;
                                  &lt;downloadUrl&gt;http://java.com/download&lt;/downloadUrl&gt;
                                  &lt;classPath&gt;
                                      &lt;mainClass&gt;org.project16x16.sidescroller.SideScroller&lt;/mainClass&gt;
                                      &lt;preCp&gt;anything&lt;/preCp&gt;
                                  &lt;/classPath&gt;
                                  &lt;jre&gt;
                                      &lt;bundledJre64Bit&gt;false&lt;/bundledJre64Bit&gt;
                                      &lt;bundledJreAsFallback&gt;false&lt;/bundledJreAsFallback&gt;
                                      &lt;minVersion&gt;1.8.0&lt;/minVersion&gt;
                                      &lt;jdkPreference&gt;preferJre&lt;/jdkPreference&gt;
                                      &lt;runtimeBits&gt;32&lt;/runtimeBits&gt;
                                  &lt;/jre&gt;
                                  &lt;versionInfo&gt;
                                      &lt;fileVersion&gt;1.0.0.0&lt;/fileVersion&gt;
                                      &lt;txtFileVersion&gt;${project.version}&lt;/txtFileVersion&gt;
                                      &lt;fileDescription&gt;${project.name}&lt;/fileDescription&gt;
                                      &lt;copyright&gt;2017 spiraluplabs.com&lt;/copyright&gt;
                                      &lt;productVersion&gt;1.0.0.0&lt;/productVersion&gt;
                                      &lt;txtProductVersion&gt;1.0.0.0&lt;/txtProductVersion&gt;
                                      &lt;productName&gt;${project.name}&lt;/productName&gt;
                                      &lt;companyName&gt;SpiralUp&lt;/companyName&gt;
                                      &lt;internalName&gt;SpiralShareAutoAllocation&lt;/internalName&gt;
                                      &lt;originalFilename&gt;SpiralShareAutoAllocation.exe&lt;/originalFilename&gt;
                                  &lt;/versionInfo&gt;
                              &lt;/configuration&gt;
                          &lt;/execution&gt;
                      &lt;/executions&gt;
                  &lt;/plugin&gt;
              &lt;/plugins&gt;
          &lt;/pluginManagement&gt;
      &lt;/build&gt;
  &lt;/project&gt;
  
  
  </code></pre>
  
  <p>This is the error I'm getting:</p>
  
  <pre><code>[INFO] Building Project16x16 1.0.0
  [INFO] --------------------------------[ jar ]---------------------------------
  [WARNING] The POM for org.processing:core:jar:3.3.6 is invalid, transitive dependencies (if any) will not be available, enable debug logging for more details
  [INFO]
  [INFO] --- launch4j-maven-plugin:1.7.25:launch4j (default-cli) @ Project16x16 ---
  [INFO] Platform-specific work directory already exists: C:\Users\aless\.m2\repository\net\sf\launch4j\launch4j\3.12\launch4j-3.12-workdir-win32
  
  net.sf.launch4j.BuilderException: Enter: Header type 
      at net.sf.launch4j.Builder.build (Builder.java:76)
      at com.akathist.maven.plugins.launch4j.Launch4jMojo.doExecute (Launch4jMojo.java:432)
      at com.akathist.maven.plugins.launch4j.Launch4jMojo.execute (Launch4jMojo.java:321)
      at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
      at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
      at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
      at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
      at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
      at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
      at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
      at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956)
      at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
      at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
      at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke (Method.java:498)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
      at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
      at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
      at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time:  2.706 s
  [INFO] Finished at: 2019-10-07T16:58:38+02:00
  [INFO] ------------------------------------------------------------------------
  [ERROR] Failed to execute goal com.akathist.maven.plugins.launch4j:launch4j-maven-plugin:1.7.25:launch4j (default-cli) on project Project16x16: Failed to build the executable; please ver
  ify your configuration.: Enter: Header type -&gt; [Help 1]
  
  </code></pre>
  
  <p>The command I'm using is the following:
  <code>mvn com.akathist.maven.plugins.launch4j:launch4j-maven-plugin:launch4j</code></p>
  
  <p>I've searched for the error I'm getting but I cannot figure out a solution to this. 
  Any help is appreciated!</p>
  
  <p>Thanks</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>If i run <code>mvn clean package</code> I get the following log:</p>
  
  <pre><code>[INFO] --------------------&lt; org.project1616:Project16x16 &gt;--------------------
  [INFO] Building Project16x16 1.0.0
  [INFO] --------------------------------[ jar ]---------------------------------
  [INFO]
  [INFO] --- maven-clean-plugin:3.1.0:clean (default-clean) @ Project16x16 ---
  [INFO] Deleting C:\Users\aless\Documents\Università\Secondo anno\Programmazione orientata agli oggetti\Project16x16\source\target
  [INFO]
  [INFO] --- maven-resources-plugin:3.0.2:resources (default-resources) @ Project16x16 ---
  [INFO] Using 'UTF-8' encoding to copy filtered resources.
  [INFO] Copying 57 resources
  [INFO]
  [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ Project16x16 ---
  [INFO] Changes detected - recompiling the module!
  [INFO] Compiling 49 source files to C:\Users\aless\Documents\Università\Secondo anno\Programmazione orientata agli oggetti\Project16x16\source\target\classes
  [WARNING] /C:/Users/aless/Documents/Università/Secondo anno/Programmazione orientata agli oggetti/Project16x16/source/src/main/java/org/project16x16/sidescroller/SideScroller.java: Some
  input files use or override a deprecated API.
  [WARNING] /C:/Users/aless/Documents/Università/Secondo anno/Programmazione orientata agli oggetti/Project16x16/source/src/main/java/org/project16x16/sidescroller/SideScroller.java: Recom
  pile with -Xlint:deprecation for details.
  [INFO]
  [INFO] --- maven-resources-plugin:3.0.2:testResources (default-testResources) @ Project16x16 ---
  [INFO] Using 'UTF-8' encoding to copy filtered resources.
  [INFO] skip non existing resourceDirectory C:\Users\aless\Documents\Università\Secondo anno\Programmazione orientata agli oggetti\Project16x16\source\src\test\resources
  [INFO]
  [INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ Project16x16 ---
  [INFO] Changes detected - recompiling the module!
  [INFO] Compiling 1 source file to C:\Users\aless\Documents\Università\Secondo anno\Programmazione orientata agli oggetti\Project16x16\source\target\test-classes
  [INFO]
  [INFO] --- maven-surefire-plugin:2.22.1:test (default-test) @ Project16x16 ---
  [INFO]
  [INFO] --- maven-jar-plugin:3.0.2:jar (default-jar) @ Project16x16 ---
  [INFO] Building jar: C:\Users\aless\Documents\Università\Secondo anno\Programmazione orientata agli oggetti\Project16x16\source\target\Project16x16-1.0.0.jar
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD SUCCESS
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time:  10.716 s
  [INFO] Finished at: 2019-10-08T10:34:39+02:00
  [INFO] ------------------------------------------------------------------------
  </code></pre>
  
  <p>The launch4j plugin is not even used! I updated the <code>pom.xml</code> too.</p>