带有JavaFX的JWrapper无法在Windows上启动

时间:2016-09-07 23:36:02

标签: jwrapper

我们有一个应用程序,我们最近添加了JavaFX,并更新到最新的JRE,现在Jwrapper不会在Windows上启动应用程序(MacOS和Linux都很好)。

我们已按照此帖http://www.jwrapper.com/blog/bundling-javafx-into-a-native-exe上的说明操作,并相应更改了我们的JWrapper配置。

我们使用的是JDK1.80_102和JWrapper版本:jwrapper-00044250826.jar。我们正在通过maven构建(我们有一个插件可以执行此操作)。

应用程序下载,但不会启动。请参阅以下日志:

+0        ----- Starting Launcher -----
+0        [Launcher]     Arg[0]=C:\Users\username\AppData\Roaming\JWrapper-APPNAME (UAT)\JWrapper-Windows64JRE-00046316492-complete\bin\APPNAME (UAT).exe
+0        [Launcher]     Arg[1]=-cp
+0        [Launcher]     Arg[2]=C:\Users\username\AppData\Roaming\JWrapper-APPNAME (UAT)\JWrapper-APPNAME (UAT)-00046316696-complete\jarname-all-3012-SNAPSHOT.jar;C:\Users\username\AppData\Roaming\JWrapper-APPNAME (UAT)\JWrapper-APPNAME (UAT)-00046316696-complete\jwrapper_utils.jar
+0        [Launcher]     Arg[3]=-Xms256m
+0        [Launcher]     Arg[4]=-Xmx1024m
+0        [Launcher]     Arg[5]=-Duser.groovyServer=groovy.server.url.com
+0        [Launcher]     Arg[6]=-DcurrentEnvironment=UAT
+0        [Launcher]     Arg[7]=-DreqServerVersion=2016-09-08:1.0-0
+0        [Launcher]     Arg[8]=-DprojectVersion=3012-SNAPSHOT
+0        [Launcher]     Arg[9]=-DstartBanner=o3gui/images/app_banner.gif
+0        [Launcher]     Arg[10]=-Dswing.aatext=true
+0        [Launcher]     Arg[11]=-Dapple.laf.useScreenMenuBar=true
+0        [Launcher]     Arg[12]=-Dcom.apple.mrj.application.apple.menu.about.name=APPNAME
+0        [Launcher]     Arg[13]=3
+0        [Launcher]     Arg[14]=-Djavafx.macosx.embedded=true
+0        [Launcher]     Arg[15]=jwrapper.JWrapper
+0        [Launcher]     Arg[16]=C:\Users\username\AppData\Roaming\JWrapper-APPNAME (UAT)\JWrapper-APPNAME (UAT)-00046316696-complete\JWLaunchProperties-1473288163056-24
+15       [Launcher] Found tail marker
+0        [Launcher] App Name = APPNAME (UAT)
+0        [Launcher] App Version = 
+0        [Launcher] JRE Version = 
+0        [Launcher] GU Version = 
+0        [Launcher] Min Splash MS = 850
+0        [Launcher] Signature Public Key = 
+0        [Launcher] Can Override Splash = 0
+0        [Launcher] Install Type = perm_user
+0        [Launcher] Silent Parameter = 
+0        [Launcher] Update URL = 8
+0        [Launcher] ExePath is C:\Users\username\AppData\Roaming\JWrapper-APPNAME (UAT)\JWrapper-Windows64JRE-00046316492-complete\bin\APPNAME (UAT).exe
+0        [Launcher] Master dir from exe path is C:\Users\username\AppData\Roaming\JWrapper-APPNAME (UAT)
+0        [Launcher] Master folder is C:\Users\username\AppData\Roaming\JWrapper-APPNAME (UAT)
+0        [Launcher] Located existing bin JRE runtime = C:\Users\username\AppData\Roaming\JWrapper-APPNAME (UAT)\JWrapper-Windows64JRE-00046316492-complete
+0        [Launcher] JRE path is C:\Users\username\AppData\Roaming\JWrapper-APPNAME (UAT)\JWrapper-Windows64JRE-00046316492-complete
+0        [JNILaunch] Bin folder is C:\Users\username\AppData\Roaming\JWrapper-APPNAME (UAT)\JWrapper-Windows64JRE-00046316492-complete\bin
+0        File exists: C:\Users\username\AppData\Roaming\JWrapper-APPNAME (UAT)\JWrapper-Windows64JRE-00046316492-complete\bin\server\jvm.dll
+0        [JNILaunch] Trying to load library C:\Users\username\AppData\Roaming\JWrapper-APPNAME (UAT)\JWrapper-Windows64JRE-00046316492-complete\bin\server\jvm.dll [exists=1]
+1        [JNILaunch] Unable to load library. Will attempt fallback.
+0        [JNILaunch] Trying to load library C:\Users\username\AppData\Roaming\JWrapper-APPNAME (UAT)\JWrapper-Windows64JRE-00046316492-complete\bin\client\jvm.dll [exists=0]
+0        [JNILaunch] Unable to load second library.
+0        [JNILaunch] [ERROR] Unable to load JRE library!

1 个答案:

答案 0 :(得分:0)

注意:这是一种解决方法,而不是解决此问题的方法。

如果有其他人遇到此问题,则一个解决方法将使用 32位 Windows JRE。

正如在日志中可以注意到的那样,当JWrapper启动JNI启动时,它将尝试"服务器" JVM优先(...\bin\server\jvm.dll),存在于64位JRE中。

然后,由于某些原因失败(JWrapper没有提供任何有用的信息),JWrapper将尝试加载"客户端" JVM(...\bin\client\jvm.dll)。

"客户" JVM并不存在于64位JRE中(并且它已经存在很长时间了,不确定为什么JWrapper仍在尝试加载它)。

现在,如果您使用 32位版本,您应该会注意到日志中的更改:

++++++++++++++++++++++++++++++++++++++++++++++++
[JNILaunch] Bin folder is C:\Users\IEUser\AppData\Roaming\JWrapperApp\JWrapper-Windows64JRE-00046325420-complete\bin
[JNILaunch] Trying to load library C:\Users\IEUser\AppData\Roaming\JWrapperApp\JWrapper-Windows64JRE-00046325420-complete\bin\server\jvm.dll [exists=0]
[JNILaunch] Unable to load library. Will attempt fallback.
File exists: C:\Users\IEUser\AppData\Roaming\JWrapperApp\JWrapper-Windows64JRE-00046325420-complete\bin\client\jvm.dll
[JNILaunch] Trying to load library C:\Users\IEUser\AppData\Roaming\JWrapperApp\JWrapper-Windows64JRE-00046325420-complete\bin\client\jvm.dll [exists=1]
[JNILaunch] Unable to load second library.
[JNILaunch] [ERROR] Unable to load JRE library!
[Extractor] Return code for JNI launch was 1
------------------------------------------------
--- End: JNI Launch

------------------------------------------------
[Extractor] JNI launch failed. Attempting legacy spawn instead
[Extractor] Attempting spawn launch
++++++++++++++++++++++++++++++++++++++++++++++++
+++ Start: Spawn launch

++++++++++++++++++++++++++++++++++++++++++++++++
[Utils] Closing logging file.

现在情况已经倒转,"服务器"找不到JVM,"客户端"是(如预期的那样)。

JWrapper仍然无法加载它,但它仍然没有提供任何有用的信息来说明它无法加载。

现在的主要区别在于,即使JWrapper无法加载客户端JVM,它也会尝试使用传统的spawn,这在我的情况下运行良好。