SyntaxHighlighter

2012-10-17

JavaFX standalone application with external jar

To compile/build a JavaFX standalone application with external jar CORRECTLY.

with the code below, I get runtime exception as the others.

     <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="*.jar"/>
              <fx:fileset dir="${basedir}/${dist.dir}/lib" includes="*.jar"/>
          </fx:resources>
          <fx:info title="${application.title}" 
                   vendor="${application.vendor}"/>
        </fx:deploy>
     </target>

but I fix it finally.
with the code below, the external jars go to the right location.
     <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="*.jar"/>
              <fx:fileset dir="${basedir}/${dist.dir}" includes="lib/*.jar"/>
          </fx:resources>
          <fx:info title="${application.title}" 
                   vendor="${application.vendor}"/>
        </fx:deploy>
     </target>

All the thing I done is just set the external jar's dir and includes in to the correct way.
from
<fx:fileset dir="${basedir}/${dist.dir}/lib" includes="*.jar"/>
to
<fx:fileset dir="${basedir}/${dist.dir}" includes="lib/*.jar"/>

0 件のコメント:

人気の投稿