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.
First I tried with the NetBeans native packager, as showed in https://netbeans.org/kb/docs/java/native_pkg.html#fx , 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:
<?xml version="1.0" encoding="UTF-8"?>
<project name="Petra" default="default" basedir="." xmlns:fx="javafx:com.sun.javafx.tools.ant">
<description>Builds, tests, and runs the project Petra.</description>
<import file="nbproject/build-impl.xml"/>
<target name="-post-jfx-deploy">
<fx:deploy width="${javafx.run.width}" height="${javafx.run.height}"
nativeBundles="all"
outdir="${basedir}/${dist.dir}" outfile="${application.title}">
<fx:application name="${application.title}" mainClass="${javafx.main.class}"/>
<fx:resources>
<fx:fileset dir="${basedir}/${dist.dir}" includes="Petra.jar"/>
</fx:resources>
<fx:info title="${application.title}" vendor="${application.vendor}"/>
<fx:platform basedir="C:\Program Files\Java\jdk1.8.0_60"/>
</fx:deploy>
</target>
</project>
Nothing seems to be wrong in the output when compile:
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 <fx:jar> task from C:\Program Files\Java\jdk1.8.0_60\jre\..\lib\ant-javafx.jar
Launching <fx:deploy> 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)
But when I run the installer, the "exe" generated throws this two windows:
Any clues on this??