Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mac的Java应用程序包不处理参数_Java_Macos_Javafx_Ant_Bundle - Fatal编程技术网

Mac的Java应用程序包不处理参数

Mac的Java应用程序包不处理参数,java,macos,javafx,ant,bundle,Java,Macos,Javafx,Ant,Bundle,我正在将一个遗留Java应用程序更新为,以便它能够使用Java 8运行。我正在使用ant和JavaFX。此应用程序需要一组参数。我已经用指定了参数,它们出现在生成的cfg文件中,但是,当通过单击图标启动应用程序时,它们不会被处理。参数在通过命令行启动应用程序时进行处理 ant脚本: <project name="xxxxxx" default="default" basedir="." xmlns:fx="javafx:com.sun.javafx.tools.ant"> &l

我正在将一个遗留Java应用程序更新为,以便它能够使用Java 8运行。我正在使用ant和JavaFX。此应用程序需要一组参数。我已经用指定了参数,它们出现在生成的cfg文件中,但是,当通过单击图标启动应用程序时,它们不会被处理。参数在通过命令行启动应用程序时进行处理

ant脚本:

<project name="xxxxxx" default="default" basedir="." xmlns:fx="javafx:com.sun.javafx.tools.ant">

  <property name="JAVA_HOME" value="/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home"/>

  <echo message="JAVA_HOME: ${JAVA_HOME}" />

  <property name="build.src.dir" value="src"/>
  <property name="build.classes.dir" value="classes"/>
  <property name="build.dist.dir" value="dist"/>
  <property name="build.java.resources.dir" value="../Contents/Java"/>

  <target name="default">

    <taskdef resource="com/sun/javafx/tools/ant/antlib.xml" uri="javafx:com.sun.javafx.tools.ant" classpath="${JAVA_HOME}/lib/ant-javafx.jar"/>

    <fx:application id="xxxxxx" name="xxxxxx" mainClass="com.xxxx">
          <fx:argument>-application com.xxxxx.Application -image xxxxxx/splashscreen.jpg -background black -title xxxxx -dock_icon ../application.icns -mem_max 1024</fx:argument>
    </fx:application>

    <fx:resources id="appRes">
          <fx:fileset dir="${build.dist.dir}" includes="Startup.jar"/>
    </fx:resources>

    <fx:jar destfile="${build.dist.dir}/Startup.jar">
          <fx:application refid="xxxxxxx"/>
          <fx:resources refid="appRes"/>
          <fx:fileset dir="${build.classes.dir}"/>
    </fx:jar>

    <fx:deploy width="300" height="250"
           outdir="./deploy" embedJNLP="false"
           outfile="xxxxxxx"
           signBundle="false"
           nativeBundles="all">

           <fx:application refId="xxxx"/>

           <fx:resources refid="appRes"/>

           <fx:info title="xxxxx" vendor="xxx"/>
    </fx:deploy>
   </target>
 </project>

任何线索都值得欣赏。

看起来每个参数都需要单独指定,例如:

    <fx:argument>-application</fx:argument>
    <fx:argument>com.xxxx.Application</fx:argument>
    <fx:argument>-image</fx:argument> 
    <fx:argument>com/xxxx/splashscreen.jpg</fx:argument> 
-应用程序
com.xxxx.com应用程序
-形象
com/xxxx/splashscreen.jpg
    <fx:argument>-application</fx:argument>
    <fx:argument>com.xxxx.Application</fx:argument>
    <fx:argument>-image</fx:argument> 
    <fx:argument>com/xxxx/splashscreen.jpg</fx:argument>