AppBundler 不在 OS X Java App 中包含来自 JRE 的二进制文件

AppBundler doesn't include binaries from JRE in OS X Java App

我正在尝试将我的 java 应用程序打包到 OS X App Bundle 中,我想包含 JRE,这样它就可以 运行 而无需安装 JRE。

我正在关注 http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/packagingAppsForMac.html

AppBundler Ant 任务将生成一个包含 JRE 的 .app,但它缺少所有二进制文件。

该应用程序将 运行 但我不确定它没有使用我安装的 JRE,因为它缺少二进制文件。或者包含的 JavaAppLauncher 是否替换了正常的 java 二进制文件?

在应用程序中捆绑 JRE 时不包括 bin/ 文件夹。它使用的唯一本地二进制文件位于 MyApp/Contents/MacOS 和 MyApp/Contents/Plugins/MyJRE/Contents/MacOS.

Or does the included JavaAppLauncher replaces the normal java binary?

应用程序包未调用 'java' 命令。 JavaAppLauncher 和 libjli.dylib 的某种组合动态调用 Java。

如果您不确定它是否使用 Java 的捆绑版本,请在您的应用程序运行时输出它。它会告诉您从哪个位置 Java 被调用:

System.getProperty("java.home", "")