Mohammad Sadiq Shaikh
Mohammad Sadiq Shaikh

Reputation: 3200

Adding external jar file in JavaFX build

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?,

Upvotes: 0

Views: 4515

Answers (2)

Maher Abuthraa
Maher Abuthraa

Reputation: 17813

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

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

hope that will help ..

Upvotes: 0

Mohammad Sadiq Shaikh
Mohammad Sadiq Shaikh

Reputation: 3200

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"/>

Upvotes: 1

Related Questions