我开发了 javafx 应用程序,它使用 apache 的 httpclient jar 来发出 http 请求。
部署应用程序时,我按照文档使用了 winx 和 Inno 设置
我的build.xml文件如下:
<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>
但是当生成打包的可执行文件时,它似乎不包含 httpjars,因为它会抛出异常。
如何在构建中添加外部 jar 文件?,
最佳答案
当我将以下内容添加到我的 javafx 应用程序构建文件时工作
<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"/>
关于java - 在 JavaFX 构建中添加外部 jar 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15341567/