简体   繁体   中英

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

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

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

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

hope that will help ..

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM