I'm facing a problem currently with JavaFX. I would like to create an exe or an installer for my application. I used Netbeans and Eclipse, but none works.
I've been searching on the web and there are many great advice to make it work.
But nobody talks about external files.
Here is my project :
-data
--db.sqlite
-src
--css
--html
--com.stackoverflow.....
-lib
And here is a part of my build.xml file I use in NetBeans :
<?xml version="1.0" encoding="UTF-8"?>
<project name="GTBad2.0" default="default" basedir="." xmlns:fx="javafx:com.sun.javafx.tools.ant">
<description>My application.</description>
<import file="nbproject/build-impl.xml"/>
<target name="-post-jfx-deploy">
<taskdef resource="com/sun/javafx/tools/ant/antlib.xml"
uri="javafx:com.sun.javafx.tools.ant"
classpath=".:path/to/sdk/lib/ant-javafx.jar"/>
<fx:deploy verbose="true" 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="*.jar"/>
<fx:fileset dir="${basedir}/${dist.dir}" includes="lib/*.jar"/>
</fx:resources>
<fx:info title="MyApp" vendor="me"/>
</fx:deploy>
</target>
</project>
The libs are correctly imported in my build.xml. But how to make sure to include css, html and data directories ? My database seems to be loaded only if I use absolute paths in the code instead of using
DriverManager.getConnection("jdbc:sqlite:data/db.sqlite");
Thanks for helping me.
EDIT :
Thanks for your replies. But I'm not asking if it is possible or not to create an exe. It is. JavaFX (e(fx)eclipse for example) provides tools to create an exe from a build.xml.
I can assure you that it works because it worked for me for simple javafx projects.
What I'm asking is how to link the database file and resources file to my exe.
Hope my asking is understandable.