How to set the install path on a self-contained app JavaFX .deb (Debian) package


April 2019


72 time


I'm trying to generate a .deb file, containing a self-contained copy of my JavaFX application, using the Oracle JavaFX Ant fx:deploy Task.

I've followed the samples on official documentation and my pom.xml configuration looks like this:

                <target xmlns:fx="">
                    <manifestclasspath property="manifest.classpath" jarfile="${application.dist}/${}.jar">
                            <path id="build.classpath">
                                <fileset dir="${application.dist}/lib">
                                    <include name="*.jar"/>

                    <taskdef resource="com/sun/javafx/tools/ant/antlib.xml"

                    <fx:preferences id="fxPreferences" shortcut="true" menu="true" install="true"/>

                    <fx:jar destfile="${application.dist}/${}.jar">
                        <fx:application name="${application.title}"
                            <attribute name="Class-Path" value="${manifest.classpath}"/>
                        <!-- The target/classes folder which contains all resources and
                                    class files -->
                        <fileset dir="${}"/>

                    <fx:resources id="appRes">
                        <fx:fileset dir="${classes.dir}" includes="*.ico"/>
                        <fx:fileset dir="${classes.dir}" includes="*.bat"/>
                        <fx:fileset dir="${classes.dir}" includes="*.conf"/>
                        <fx:fileset dir="${application.dist}" includes="*.jar"/>
                        <fx:fileset dir="${application.dist}" includes="lib/*.jar"/>
                        <fx:fileset dir="${java.home}/lib/ext" includes="sunjce_provider.jar" type="data"/>
                        <fx:fileset dir="${java.home}/bin" includes="java.exe" type="data"/>
                        <fx:fileset dir="${java.home}/bin" includes="javaw.exe" type="data"/>
                        <fx:fileset dir="${extra.dir}" includes="**"/>

                    <!-- This same fx:deploy task MUST be able to generate a Windows .EXE bundle as well -->
                    <fx:deploy verbose="true" embedJNLP="false" extension="false" includeDT="false"
                               offlineAllowed="true" outdir="${application.dist}"
                               outfile="${}" nativeBundles="all" updatemode="background">
                        <fx:application name="${}" mainClass="${application.main.class}"/>
                        <fx:resources refid="appRes"/>
                        <fx:preferences refId="fxPreferences" shortcut="true" menu="true"/>
                        <fx:info title="${application.title}" vendor="${application.vendor}"/>

                        <fx:platform javafx="8.0+">
                            <fx:jvmarg value=""/>

At the end of the build (mvn clean install), the .deb file is properly generated at /target/dist/bundles folder.

But when I install it with dpkg -i, my application will be installed at /opt/${}.

The DEB packaging options documentation says the default installation location will be /opt, but it don't tell me how can I change it.

My question is: how may I set another installation path to override the default /opt value?

For example, it would be great if I could install it on /opt/company/apps/${}.

I've read about the usage of fx:bundleArgument inside fx:deploy, which has fixed options. But none of the linux.* options it's related about installation path.

Environment information:

  • Debian 8.10 Jessie
  • JDK 1.8.0_171 64bits
  • dpkg-deb 1.17.27 (amd64)
  • Apache Maven 3.0.5

0 answers