我正在开发一个 JavaFX 应用程序并使用本机打包工具(包括 Inno Setup 5 和 WiX)来创建 .exe 文件和安装程序。该程序是一个自包含的应用程序。当我在自己的计算机(Windows 10)上安装并执行它时,它似乎没有运行。单击启动图标后的错误消息是:“没有主类”,关闭此对话框后另一个对话框错误:“无法启动 JVM”
构建.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=
有人知道问题出在哪里吗?提前致谢!