Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 262507 - javafx unable to run jar outside dist folder
javafx unable to run jar outside dist folder
Product: javafx
Classification: Unclassified
Component: Deployment
PC Windows 7
: P1 (vote)
: Dev
Assigned To: Roman Svitanic
Depends on:
  Show dependency treegraph
Reported: 2016-06-21 09:51 UTC by pbuser
Modified: 2017-05-10 12:31 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT


Note You need to log in before you can comment on or make changes to this bug.
Description pbuser 2016-06-21 09:51:34 UTC
I'm unable to run jar outside the dist folder.

Here is the build.xml I have used. I'm not sure how to add the libraries in the MyProject jar using the build.xml.

<?xml version="1.0" encoding="UTF-8"?>
<project name="MyProject" default="default" basedir="." xmlns:fx="">
    <description>Builds, tests, and runs the project MyProject.</description>
    <import file="nbproject/build-impl.xml"/>
     <target name="-post-jfx-deploy">
           <fx:deploy width="${}" height="${}" 
                     outdir="${basedir}/${dist.dir}" outfile="${application.title}">
              <fx:application name="${application.title}" mainClass="${javafx.main.class}"/>
                  <fx:fileset dir="${basedir}/${dist.dir}" includes="MyProject.jar"/>
              <fx:info title="MyProject" vendor="MyProject"/>
Comment 1 pbuser 2016-07-27 08:44:54 UTC
Please let me know if I missed any information.
Comment 2 Tomas Zezula 2017-05-10 12:31:09 UTC
<fx:fileset dir="${basedir}/${dist.dir}" includes="MyProject.jar"/>
is missing the dependencies copied into the ${dist.dir}/lib.
You need to add them as well:
<fx:fileset dir="${basedir}/${dist.dir}/lib" includes="*.jar"/>

But better is to use the IDE built in JFX packaging which can be configured in the JFX Project Properties/Build/Deployment.
You need to enable "Enable Native Packaging"
And after it the JFX Project will have action "Package As" in the pop up menu.

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo