JavaFX包

JavaFX教程 – JavaFX包

要分发或部署JavaFX应用程序,我们需要打包JavaFX应用程序类。

要处理应用程序打包和部署,我们可以使用JavaFX Packager工具来构建,打包和部署应用程序。

以下步骤显示如何使用JavaFX Packager工具。

转到源文件夹如下

cd com/w3cschool

编译源文件

javac -d  . HelloWorldMain.java

运行javafxpackager命令

javafxpackager -createjar -appclass com.w3cschool.HelloWorldMain -srcdir . -outdir  out
-outfile  helloworld.jar -v
  • -createjar creates a JavaFX JAR executable application.
  • -appclass com.w3cschool.HelloWorldMain specifies the fully qualified name of the class containing the main() method.
  • -srcdir . sets the top-level location of the parent directory holding the compiled classes (current directory).
  • -outdir out sets the destination where the packaged jar file will be created.
  • -outfile helloworld.jar specifies the name of the executable jar file.
  • -v allows verbose displays logging information when executing javafxpackager.

要在命令行上运行jar可执行文件,请键入以下内容并按Enter键:

javaw  -jar out/helloworld.jar
版权声明:本文采用知识共享 署名4.0国际许可协议 [BY-NC-SA] 进行授权
文章名称:《JavaFX包》
文章链接:https://zhuji.vsping.com/292491.html
本站资源仅供个人学习交流,请于下载后24小时内删除,不允许用于商业用途,否则法律问题自行承担。