如何将程序参数传递给Java Packager?

时间:2018-10-04 09:12:04

标签: java jvm javapackager

我正在尝试从本地拥有的.jar文件创建本地可执行文件。除了我当前正在执行带有参数(abc)的jar文件外,其他一切看起来都很好:

java -Dappbase=http://localhost:80/getdown/xyz/ -jar getdown-1.7.1.jar abc

这就是我用来生成本机图像的内容:

javapackager \
  -deploy -BjvmProperties=appbase=http://localhost:80/getdown/xyz/ \
  -native \
  -outdir result \
  -outfile sample \
  -srcfiles getdown-1.7.1.jar \
  -appclass com.threerings.getdown.launcher.GetdownApp

如何用javapackager作为信号通知com.threerings.getdown.launcher.GetdownApp我希望它运行abc

谢谢

1 个答案:

答案 0 :(得分:0)

这可能会对您有所帮助。

来源: https://docs.oracle.com/javafx/2/deployment/javafx_ant_task_reference002.htm

https://docs.oracle.com/javafx/2/deployment/javafx_ant_task_reference002.htm#CACIJFHB

 <fx:application name="Sample app"
    mainClass="test.MyApplication">
  <!-- unnamed arguments -->
  <fx:argument>Something</fx:argument>
  <!-- value with spaces that are generated at build time -->
  <fx:argument>JRE version: ${java.version}</fx:argument>
  <!-- example of value using a special character -->
  <fx:argument>true &amp; false</fx:argument>
 </fx:application>