title: Create JavaFX executable including JRE and external libraries
body: <p>I have developed a JavaFX application under NetBeans, which needs JRE8u60 and some external libraries (jar and dll) and a "SQLite" database file to run. I'm looking for a way to create an executable file, or an installer, which includes (or install) this version of the JRE and the needed libraries.</p>
  
  <p>First I tried with the NetBeans native packager, as showed in <a href="https://netbeans.org/kb/docs/java/native_pkg.html#fx" rel="nofollow noreferrer">https://netbeans.org/kb/docs/java/native_pkg.html#fx</a> , but when I run the installer obtained, the executable file says it can't find the main class. I just followed that tutorial, so I don't know if I missed some point necessary to fit into my particular case. My build.xml file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project name="Petra" default="default" basedir="." xmlns:fx="javafx:com.sun.javafx.tools.ant"&gt;
  &lt;description&gt;Builds, tests, and runs the project Petra.&lt;/description&gt;
  &lt;import file="nbproject/build-impl.xml"/&gt;
  &lt;target name="-post-jfx-deploy"&gt;
     &lt;fx:deploy width="${javafx.run.width}" height="${javafx.run.height}" 
               nativeBundles="all"
               outdir="${basedir}/${dist.dir}" outfile="${application.title}"&gt;
        &lt;fx:application name="${application.title}" mainClass="${javafx.main.class}"/&gt;
        &lt;fx:resources&gt;
            &lt;fx:fileset dir="${basedir}/${dist.dir}" includes="Petra.jar"/&gt;
        &lt;/fx:resources&gt;
        &lt;fx:info title="${application.title}" vendor="${application.vendor}"/&gt;
        &lt;fx:platform basedir="C:\Program Files\Java\jdk1.8.0_60"/&gt; 
    &lt;/fx:deploy&gt;  
  &lt;/target&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>Nothing seems to be wrong in the output when compile:</p>
  
  <pre><code>ant -f C:\\Users\\jros\\Documents\\NetBeansProjects\\Petra jfx-rebuild
  init:
  deps-clean:
  Updating property file: C:\Users\jros\Documents\NetBeansProjects\Petra\build\built-clean.properties
  Deleting directory C:\Users\jros\Documents\NetBeansProjects\Petra\build
  clean:
  init:
  deps-jar:
  Created dir: C:\Users\jros\Documents\NetBeansProjects\Petra\build
  Updating property file: C:\Users\jros\Documents\NetBeansProjects\Petra\build\built-jar.properties
  Created dir: C:\Users\jros\Documents\NetBeansProjects\Petra\build\classes
  Created dir: C:\Users\jros\Documents\NetBeansProjects\Petra\build\empty
  Created dir: C:\Users\jros\Documents\NetBeansProjects\Petra\build\generated-sources\ap-source-output
  Compiling 19 source files to C:\Users\jros\Documents\NetBeansProjects\Petra\build\classes
  Note: Some input files use unchecked or unsafe operations.
  Note: Recompile with -Xlint:unchecked for details.
  Copying 26 files to C:\Users\jros\Documents\NetBeansProjects\Petra\build\classes
  compile:
  Created dir: C:\Users\jros\Documents\NetBeansProjects\Petra\dist
  Copying 3 files to C:\Users\jros\Documents\NetBeansProjects\Petra\dist\lib
  Detected JavaFX Ant API version 1.3
  Launching &lt;fx:jar&gt; task from C:\Program Files\Java\jdk1.8.0_60\jre\..\lib\ant-javafx.jar
  Launching &lt;fx:deploy&gt; task from C:\Program Files\Java\jdk1.8.0_60\jre\..\lib\ant-javafx.jar
  No base JDK. Package will use system JRE.
  RelativeFileSet{basedir:C:\Users\jros\Documents\NetBeansProjects\Petra\dist, files:[Petra.jar, lib\RXTXcomm.jar, lib\ojdbc6.jar, lib\sqlitejdbc-0.5.4.jar]}
  No base JDK. Package will use system JRE.
  Using base JDK at: C:\Program Files\Java\jdk1.8.0_60\jre
  RelativeFileSet{basedir:C:\Users\jros\Documents\NetBeansProjects\Petra\dist, files:[Petra.jar]}
  Using base JDK at: C:\Program Files\Java\jdk1.8.0_60\jre
  Creating app bundle: Petra in C:\Users\jros\Documents\NetBeansProjects\Petra\dist\bundles
  Result application bundle: C:\Users\jros\Documents\NetBeansProjects\Petra\dist\bundles
  Installer (.exe) saved to: C:\Users\jros\Documents\NetBeansProjects\Petra\dist\bundles
  RelativeFileSet{basedir:C:\Users\jros\Documents\NetBeansProjects\Petra\dist, files:[Petra.jar]}
  jfx-deployment-script:
  jfx-deployment:
  jar:
  jfx-rebuild:
  BUILD SUCCESSFUL (total time: 3 minutes 31 seconds)
  </code></pre>
  
  <p>But when I run the installer, the "exe" generated throws this two windows:</p>
  
  <p><img src="https://i.stack.imgur.com/JAyBr.png" alt="enter image description here"></p>
  
  <p><img src="https://i.stack.imgur.com/t9bZW.png" alt="enter image description here"></p>
  
  <p>Any clues on this??</p>