我正在尝试将我的 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", "")
关于java - AppBundler 不在 OS X Java App 中包含来自 JRE 的二进制文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28561500/