W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗(yàn)值獎(jiǎng)勵(lì)
要分發(fā)或部署JavaFX應(yīng)用程序,我們需要打包JavaFX應(yīng)用程序類。
要處理應(yīng)用程序打包和部署,我們可以使用JavaFX Packager工具來構(gòu)建,打包和部署應(yīng)用程序。
以下步驟顯示如何使用JavaFX Packager工具。
轉(zhuǎn)到源文件夾如下
cd com/w3cschool
編譯源文件
javac -d . HelloWorldMain.java
運(yùn)行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.要在命令行上運(yùn)行jar可執(zhí)行文件,請鍵入以下內(nèi)容并按Enter鍵:
javaw -jar out/helloworld.jar
Copyright©2021 w3cschool編程獅|閩ICP備15016281號(hào)-3|閩公網(wǎng)安備35020302033924號(hào)
違法和不良信息舉報(bào)電話:173-0602-2364|舉報(bào)郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號(hào)
聯(lián)系方式:
更多建議: