繁体   English   中英

如何将程序参数传递给java打包程序?

[英]How to pass program arguments to java packager?

我正在尝试从本地的 .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发出信号,我希望它以abc作为参数运行com.threerings.getdown.launcher.GetdownApp

谢谢

这可能对您有帮助。

来源: 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> 

我不能说 Java 打包程序,但是要将命令行参数传递给 Getdown,您需要执行以下操作:

java -jar getdown-1.7.1.jar appdir "" abc

appdir ""视为样板,以便您通过 abc :)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM