简体   繁体   English

VMWare + JavaFX + Mac“hello world”应用无法安装/执行

[英]VMWare + JavaFX + Mac “hello world” app fails to install/execute

I'm posting here after much study of all the previous postings (on this site and elsewhere) regarding problems in running a JavaFX application (developed using JWrapper as the launcher) in a VMWare encapsulated instance of Mac OSX 10.10. 在我对Mac OSX 10.10的VMWare封装实例中运行JavaFX应用程序(使用JWrapper作为启动程序开发)中运行JavaFX应用程序的问题进行了大量研究之后(我在此网站和其他地方)进行了大量研究。 [NOTE: edited the preceding sentence and the title of this posting on 2015-02-25 to add reference to VMWare.] [注意:在2015-02-25编辑了前一句和本帖的标题,以添加对VMWare的引用。

After experiencing failure of my much larger Java 1.8.0_25 application to install and launch in Mac OSX v10.10.1, I replicated the problem using a 3-line "Hello World" JavaFX application. 在我的大型Java 1.8.0_25应用程序在Mac OSX v10.10.1中安装和启动失败后,我使用3行“Hello World”JavaFX应用程序复制了该问题。

In both cases, I am using what seem to be the standard Mac-oriented parameter settings in the JWrapper build-parm XML: 在这两种情况下,我使用的似乎是JWrapper build-parm XML中标准的面向Mac的参数设置:

<JvmOption>-Djavafx.macosx.embedded=true</JvmOption>
<MustFork>true</MustFork>

In both cases, when attempting installation on the Mac, the JWrapper splash screen appears as expected, but then it goes away, and the application itself fails to launch. 在这两种情况下,当尝试在Mac上安装时,JWrapper启动屏幕会按预期显示,但随后会消失,应用程序本身无法启动。

Here are the links to (1) zip file with all logs from an attempted "HelloWorldFX" installation on Mac OSX v10.10.1, and (2) zip file with the log and "build" folder from the application's JWrapper build process. 以下是(1)zip文件的链接,其中包含来自Mac OSX v10.10.1上尝试的“HelloWorldFX”安装的所有日志,以及(2)zip文件,其中包含来自应用程序的JWrapper构建过程的日志和“build”文件夹。 Note that this application installs and runs fine in Windows and Ubuntu. 请注意,此应用程序在Windows和Ubuntu中安装并运行良好。

Logs: https://googledrive.com/host/0B0skoeyva4KiUDZBS1FSUXo4RUU/mac_logs.zip 日志: https//googledrive.com/host/0B0skoeyva4KiUDZBS1FSUXo4RUU/mac_logs.zip

Build folder (300MB): https://googledrive.com/host/0B0skoeyva4KiUDZBS1FSUXo4RUU/helloWorldFX_build_folder.zip 构建文件夹(300MB): https//googledrive.com/host/0B0skoeyva4KiUDZBS1FSUXo4RUU/helloWorldFX_build_folder.zip

Here are the highlights: 以下是亮点:

The HelloWorldFX code (pretty much the entirety of the application): HelloWorldFX代码(几乎是整个应用程序):

public void start(Stage stage) {
    stage.setTitle("Hello World FX");
    stage.setScene
        (new Scene(new StackPane(new Button("Hello World FX")), 600, 250));
    stage.show();
}

My complete JWrapper build parms: 我完整的JWrapper构建parms:

<JWrapper>

    <!-- The name of the app bundle -->
    <BundleName>HelloWorldFX3</BundleName>

    <!-- The specification for one app within the bundle -->
    <App>
      <Name>HelloWorldFX3</Name>
      <LogoPNG>images/logo.png</LogoPNG>
      <MainClass>helloworldfx.HelloWorldFX</MainClass>
    </App>

    <SupportedLanguages>en</SupportedLanguages>

    <!-- App is a per-user app, it won't elevate and install for all users and the shared config folder will be per-user -->
    <InstallType>CurrentUser</InstallType>

    <!-- No <UpdateURL> element included here: only interested in **offline** installation -->

    <!-- Splash and Logo -->
    <SplashPNG>images/splash.png</SplashPNG>
    <BundleLogoPNG>images/logo.png</BundleLogoPNG>

    <!-- JVM options (e.g. extra memory) -->
    <JvmOptions>
     <JvmOption>-Xmx256m</JvmOption>

     <!-- following Mac-related option IS used in this build: for info, see: http://www.jwrapper.com/old-forum.html#nabble-td409 -->
     <JvmOption>-Djavafx.macosx.embedded=true</JvmOption>

    </JvmOptions>

    <!-- The JREs JWrapper should use for Windows, Linux32, Linux64... -->
    <Windows32JRE>jrepack18/win32/jre1.8.0_25</Windows32JRE>
    <Windows64JRE>jrepack18/win32/jre1.8.0_25</Windows64JRE>
    <Linux32JRE>jrepack18/linux/jre1.8.0_25</Linux32JRE>
    <Linux64JRE>jrepack18/linuxx64/jre1.8.0_25</Linux64JRE>
    <Mac64JRE>jrepack18/macos64/jre1.8.0_25.jre</Mac64JRE> 

    <!-- The files that the app wants to bundle, here we have just one which is a JAR file and we specify that it should be on the launch classpath -->
    <File classpath='yes'>helloWorldApp/HelloWorldFX.jar</File>

    <!-- NoStripJREs option required to avoiding stripping out of JavaFX classes! For info, see: http://www.jwrapper.com/old-forum.html#nabble-td89 -->
    <NoStripJREs>true</NoStripJREs> 
    <!-- This Mac-related option IS used in this build: -->
    <MustFork>true</MustFork>

 </JWrapper>

An ominous message from the "Wrapper" log file on the Mac: 来自Mac上“Wrapper”日志文件的不祥消息:

+1 [BundleLoader] Could not load JRE bundle!

One curious line from the "Generic Updater" log file on the Mac, in which a file name is apparently truncated by JWrapper, resulting in a file not found exception: 来自Mac上“通用更新程序”日志文件的一条奇怪的行,其中文件名显然被JWrapper截断,导致找不到文件异常:

8574158 (+0) java.io.FileNotFoundException: /Users/admin/Library/Application Support/JWrapper-HelloWorldFX3/JWrapper-JWrapper-00033253833-complete/JWAppSpec- (No such file or directory)

The entirety of the "HelloWorldFX" log file on the Mac (just craps out after or while attempting to disable App Nap): Mac上的整个“HelloWorldFX”日志文件(在尝试禁用App Nap之后或尝试禁用时):

8574542 (+0) STDOUT test
8574542 (+0) STDERR test
8574543 (+1) [LogFolderCleaner] Keeping Wrapper-2015-02-18-23-56-04-443.log
8574543 (+0) [LogFolderCleaner] Keeping HelloWorldFX3-HelloWorldFX3-2015-02-18-23-56-14-525.log
8574544 (+1) [LogFolderCleaner] Keeping GenericUpdater-2015-02-18-23-56-13-488.log
8574545 (+1) [EDT Exception Printer] Catching all EDT and uncaught exceptions and printing
8574548 (+3) [JWrapperNative] Detected 64-bit architecture
8574548 (+0) [JWrapperNative] Detected Mac OS
8574551 (+3) [JWrapper] sun.java2d.dpiaware: null
8574558 (+7) [JWDetectedProxy] No proxy configuration found to load.
8574559 (+1) JVM Option: -Xmx256m
8574559 (+0) JVM Option: -Djavafx.macosx.embedded=true
8574559 (+0) [JWrapper] JVM Home: /Users/admin/Library/Application Support/JWrapper-HelloWorldFX3/JWrapper-Mac64JRE-00034082796-complete
8574573 (+14) [JWrapper] Wrote JVM Options OK
8574574 (+1) [JWrapper] Set app name to HelloWorldFX3
8574577 (+3) [JWrapper] Loading virtual app
8574577 (+0) [JWrapper] Got virtual app HelloWorldFX3
8574577 (+0) [JWrapper] Setting OS dock info
8574786 (+209) [JWrapper] Image: BufferedImage@5ef04b5: type = 6 ColorModel: #pixelBits = 32 numComponents = 4 color space = java.awt.color.ICC_ColorSpace@5f4da5c3 transparency = 3 has alpha = true isAlphaPre = false ByteInterleavedRaster: width = 256 height = 245 #numDataElements 4 dataOff[0] = 3
8574887 (+101) [JWrapper] Disabling App Nap

Any assistance with getting this problem resolved would be GREATLY appreciated!! 解决这个问题的任何帮助都将非常感激!!

All this launch looks OK, the fact that the HelloWorldFX3 log was produced at all would indicate that the app did launch. 所有这一次启动看起来都不错,HelloWorldFX3日志的生成完全表明应用程序确实启动了。

The message 'Disabling App Nap' is just the last message that JWrapper prints before it hands over control so that doesn't indicate that it failed to launch. “禁用App Nap”消息只是JWrapper在移交控件之前打印的最后一条消息,因此并不表示它无法启动。

Do you get any hs_err_pid files generated anywhere? 你有没有在任何地方生成任何hs_err_pid文件?

What is the main method for your app like, are you able to put in a printout and check if it reaches that point in the logs? 您的应用程序的主要方法是什么,您是否可以输入打印输出并检查它是否到达日志中的那一点?

My best guess at this point would be that although you have NoStripJRE specified maybe you haven't deleted the pre-built JRE archives from your build folder? 我在这一点上最好的猜测是,虽然您指定了NoStripJRE,但您可能还没有从构建文件夹中删除预先构建的JRE存档? If not then JWrapper will continue to use those and won't rebuild them and you won't have the JavaFX components to allow your app to run. 如果没有,那么JWrapper将继续使用它们并且不会重建它们,并且您将没有JavaFX组件来允许您的应用程序运行。 I would suggest removing those and rebuilding and giving that another whirl. 我建议删除那些并重建并给予另一个旋转。 Beyond that if there is a hs_err_pid file it may have more info. 除此之外,如果有一个hs_err_pid文件,它可能有更多的信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM