使用Ant创建的JavaFX .exe文件失败

时间:2017-02-22 12:00:43

标签: javafx deployment ant self-contained

我正在开发JavaFX应用程序并使用本机打包工具(包括Inno Setup 5和WiX)来创建.exe文件和安装程序。该程序是一个自包含的应用程序。当我在自己的计算机(Windows 10)上安装并执行它时,似乎没有运行。单击启动图标后的错误消息是:"没有主要类"关闭此对话框后,出现另一个对话框错误:"无法启动JVM"

build.xml

<?xml version="1.0" encoding="UTF-8"?>
<project name="SVG Prototype Application" basedir="." xmlns:fx="javafx:com.sun.javafx.tools.ant">
<path id="fxant">
    <filelist>
        <file name="C:\Program Files\Java\jdk1.8.0_31\lib\ant-javafx.jar"/>
        <file name="C:\Program Files\Java\jdk1.8.0_31\jre\lib\ext\jfxrt.jar"/>
        <file name="${basedir}"/>
    </filelist>
</path>

<taskdef classpathref="fxant"
         resource="com/sun/javafx/tools/ant/antlib.xml"
         uri="javafx:com.sun.javafx.tools.ant"/>

<fx:application id="fxApplication"
                name="Test Application"
                mainClass="com.testlibrary.Main"
                version="1.0"
/>
<fx:jar destfile="dist/test.jar">
    <!-- Details about application -->
    <fx:application name="SVGPrototype" mainClass="com.testlibrary.Main"/>

    <!-- Define what auxilary resources are needed -->
    <fx:resources>
        <fx:fileset dir="dist" includes="lib/*.jar"/>
    </fx:resources>

    <!-- What to include into result jar file?
         Everything in the build tree -->
    <fileset dir="build/classes"/>
</fx:jar>

<fx:deploy height="400" nativeBundles="all" outdir="dist" outfile="SVGViewer" placeholderId="ZZZ" width="600">
    <fx:application name="Test Application" mainClass="com.testlibrary.Main"/>
    <fx:resources>
        <fx:fileset dir="dist" includes="test.jar"/>
        <fx:fileset dir="dist" includes="resources/**"/>
    </fx:resources>
</fx:deploy>

package.cfg已生成

app.mainjar=test.jar
app.version=1.0
app.id=com.testlibrary
app.preferences.id=com/testlibrary
app.mainclass=com/testlibrary/Main
app.classpath=

有人知道问题在哪里吗? 提前谢谢!

0 个答案:

没有答案