Adding external jar file in JavaFX build


Question

I have developed javafx app which uses httpclient jars from apache for making http requests.

When deploying the application I used winx and Inno setup as per the documentation

My build.xml file is as follows:

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

But when the packaged executable is generated it seems not to contain httpjars as it throws exception.

How to add external jar files in the build?,

1
0
3/11/2013 2:49:58 PM

Accepted Answer

Worked when I added following to my javafx application build file

<fx:fileset dir="dist" includes="lib/*.jar"/>

<fx:platform>
    <fx:jvmarg value="-Xmx1024m"/>
    <fx:jvmarg value="-verbose:jni"/>
    <property name="my.property" value="something"/>
</fx:platform>

<!-- request user level installation -->
<fx:preferences install="false"/>
1
3/15/2013 11:54:49 AM

you asked and answer :) thanks .. I faced similar problem but I solved it by :

https://stackoverflow.com/a/17092272/2267723

hope that will help ..


Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon