2013-04-30 66 views
2

我很難嘗試將我的javafx應用程序構建到.app(for mac)中。 我發現一個合法的方式來做到這一點,這裏是資源: http://docs.oracle.com/javafx/2/deployment/deploy_quick_start.htm 但是,它遠離我在找什麼。通過遵循這個教程,我設法從我的javafx項目中構建了一個應用程序,但是文件的大小卻很荒謬,因爲整個JRE都被捆綁在一起。我正在尋找一種方法來部署.app文件與依賴關係(這很重要)只有和沒有JRE。 (JRE應該由用戶預先安裝)。有沒有辦法做到這一點?我真的試圖找到一個,但表面。希望你們,幫助我。Netbeans javafx mac bundle沒有JRE

回答

2

說明用於包裝JavaFX應用程序作爲本機安裝的應用,而無需包括JRE:

JavaFX packaging tools update - Self-Contained Applications: Create Package without Java Runtime

使用的工具與您在問題中提到的deployment quick start相同。您只需設置fx:platform basedir=""

我只是引用這裏的文章:

This may sound a bit puzzling at first glance. Package without embedded Java Runtime is not really self-contained and obviously will not help with:

  • Deployment on fresh systems. JRE need to be installed separately (and this step will require admin permissions).
  • Possible compatibility issues due to updates of system runtime.

However, these packages are much much smaller in size. If download size matters and you are confident that user have recommended system JRE installed then this may be good option to consider if you want to improve user experience for install and launch.

Technically, this is implemented as an extension of previous feature. Pass empty string as value for 'basedir' attribute and this will be treated as request to not bundle Java runtime, e.g.

<fx:platform basedir=""/> 
+0

這看起來像一個合適的解決方案。但是,由於某種原因,它不起作用。 Neatbeans拋出一個錯誤:fx:平臺不支持「basedir」屬性。 我有最新的JDK。有任何想法嗎? – ksarunas 2013-04-30 17:58:25

+0

NetBeans不支持JavaFX部署工具的所有功能。通過從命令行直接運行基於Ant的JavaFX部署任務,在NetBeans外嘗試它。 – jewelsea 2013-04-30 18:01:01

+0

我自己並沒有嘗試過這個解決方案。當我有一段時間的時候,我會在家裏的OS X系統上嘗試它。 – jewelsea 2013-04-30 18:01:29