2013-04-30 68 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