当前位置: 首页 > 知识库问答 >
问题:

VMWare+JavaFX+Mac“Hello World”应用程序安装/执行失败

秋光熙
2023-03-14

在这两种情况下,我都使用了JWrapper build-parm XML中的面向MAC的标准参数设置:

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

在这两种情况下,当尝试在Mac上安装时,JWrapper启动屏幕会像预期的那样出现,但随后它就消失了,应用程序本身也无法启动。

以下是以下链接:(1)带有尝试在Mac OSX V10.10.1上安装“HelloWorldFX”的所有日志的zip文件;(2)带有应用程序JWrapper构建过程中的log和“build”文件夹的zip文件。注意,这个应用程序在Windows和Ubuntu中安装和运行都很好。

构建文件夹(300MB):https://googledrive.com/host/0b0skoeyva4kiudzbs1fsuxo4ruu/helloworldfx_build_folder.zip

以下是亮点:

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();
}
<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>
+1 [BundleLoader] Could not load JRE bundle!
8574158 (+0) java.io.FileNotFoundException: /Users/admin/Library/Application Support/JWrapper-HelloWorldFX3/JWrapper-JWrapper-00033253833-complete/JWAppSpec- (No such file or directory)
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

任何帮助解决此问题将不胜感激!!

共有1个答案

钱弘壮
2023-03-14

所有这些启动看起来都还可以,事实上HelloWorldFX3日志已经生成,这表明应用程序确实启动了。

消息'disabling App nap'只是JWrapper在移交控制权之前打印的最后一条消息,因此这并不表明它启动失败。

您是否在任何地方生成了任何hs_err_pid文件

 类似资料: