简体   繁体   English

JWrapper示例应用程序无法在Mac OS X 10.8.5上启动

[英]JWrapper example application fails to launch on Mac OS X 10.8.5

I'm trying to use jWrapper with Java 8, but I don't understand how to set up the JREs. 我正在尝试将jWrapper与Java 8结合使用,但是我不知道如何设置JRE。

As a test I specified (I'm On Mac OS X 10.8.5) on my JWrapper config .xml file: 作为测试,我在JWrapper config .xml文件中指定了(我在Mac OS X 10.8.5上):

<Mac64JRE>/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/</Mac64JRE> 

but this ends with exception like this: 但这以这样的异常结束:

[Archive] Adding file (99376) (Contents/Home/bin/jar)     /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/jar
**********************************
*          BUILD FAILED          *
**********************************
** Reason: (see stacktrace below)

java.util.zip.ZipException: error in opening zip file
    at java.util.zip.ZipFile.open(Native Method)
    at java.util.zip.ZipFile.<init>(ZipFile.java:128)
    at java.util.jar.JarFile.<init>(JarFile.java:136)

Some people apparently have managed to use Java 8 but I've not bee able to find any specifics, so I'm looking for a spelled out instructions…. 显然有人设法使用Java 8,但是我无法找到任何具体细节,因此我正在寻找详细说明…。


edit: more info 编辑:更多信息

This morning I renamed the file: 今天早上,我将文件重命名为:

/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/jar

to

/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/jar-orig

and it appears that JWrapper then just skips the file and the build completes and everything seems ok. 看来JWrapper然后只是跳过了文件,构建完成,一切正常。

However when I try to launch the resulting 64 bit Mac OS X .app file it fails without an error message after some tens of seconds. 但是,当我尝试启动生成的64位Mac OS X .app文件时,它在数十秒后失败,并且没有错误消息。

Looking at the log in: 查看登录:

/Users/nyholku/Library/Application Support/JWrapper-MyApp/logs

I see that the launch fails with: 我看到启动失败并显示:

+0        [ExtractArchiveFile] Extracting Contents/MacOS/libjli.dylib (::0)
+0          [ExtractArchiveFile] Extracting to /Users/nyholku/Library/Application Support/JWrapper-MyApp/JWrapperTemp-1414997025-7-app/Contents/MacOS/libjli.dylib
+0        [ChMod] Executing chmod -R 755 "/Users/nyholku/Library/Application Support/JWrapper-MyApp/JWrapperTemp-1414997025-7-app/Contents/MacOS/libjli.dylib"
+2        [ExtractArchiveFile] Extracting Contents/Home/db/lib/derby.jar (::2)
+1          [ExtractArchiveFile] Extracting to /Users/nyholku/Library/Application Support/JWrapper-MyApp/JWrapperTemp-1414997025-7-app/Contents/Home/db/lib/derby.jar.p2
+9        [ChMod] Executing chmod -R 755 "/Users/nyholku/Library/Application Support/JWrapper-MyApp/JWrapperTemp-1414997025-7-app/Contents/Home/db/lib/derby.jar.p2"
+4        [Spawner] Creating spawner
+0        [Spawner] Setting spawner exe to /Users/nyholku/Library/Application Support/JWrapper-MyApp/JWrapperTemp-1414997025-7-app/Contents/Home/bin/unpack200
+0        [Spawner] Appended argument /Users/nyholku/Library/Application Support/JWrapper-MyApp/JWrapperTemp-1414997025-7-app/Contents/Home/bin/unpack200
+0        [Spawner] Appended argument /Users/nyholku/Library/Application Support/JWrapper-MyApp/JWrapperTemp-1414997025-7-app/Contents/Home/db/lib/derby.jar.p2
+1        [Spawner] Appended argument /Users/nyholku/Library/Application Support/JWrapper-MyApp/JWrapperTemp-1414997025-7-app/Contents/Home/db/lib/derby.jar
+0        Launch Error 13.
+0          [ExtractArchiveFile] ERROR: unpack200 (/Users/nyholku/Library/Application Support/JWrapper-MyApp/JWrapperTemp-1414997025-7-app/Contents/Home/db/lib/derby.jar) does not exist!

Going back to basic I erased everything JWrapper related and started from scratch: 回到基础,我清除了所有与JWrapper相关的内容,并从零开始:

-downloaded JWrapper -downloaded sampleapp -downloaded jre-17 pack -下载的JWrapper-下载的sampleapp-下载的jre-17 pack

put them all into one directory, executed: 将它们全部放入一个目录,执行:

java -Xmx2048m -jar jwrapper-00031607960.jar sampleapp/jwrap java -Xmx2048m -jar jwrapper-00031607960.jar sampleapp / jwrap

the build finished successfully but the 64 bit Mac .app from the .dmg fails to launch and the log shows: 构建成功完成,但是.dmg中的64位Mac .app无法启动,日志显示:

+1        [ChMod] Executing chmod -R 755 "/Users/nyholku/Library/Application Support/JWrapper-SampleApp/JWrapperTemp-1415077515-5-app/Contents/Resources/zh_TW.lproj/Localizable.strings"
+2        [ExtractArchiveFile] Extracting Contents/Home/lib/alt-rt.jar (::2)
+1          [ExtractArchiveFile] Extracting to /Users/nyholku/Library/Application Support/JWrapper-SampleApp/JWrapperTemp-1415077515-5-app/Contents/Home/lib/alt-rt.jar.p2
+0        [ChMod] Executing chmod -R 755 "/Users/nyholku/Library/Application Support/JWrapper-SampleApp/JWrapperTemp-1415077515-5-app/Contents/Home/lib/alt-rt.jar.p2"
+3        [Spawner] Creating spawner
+0        [Spawner] Setting spawner exe to /Users/nyholku/Library/Application Support/JWrapper-SampleApp/JWrapperTemp-1415077515-5-app/Contents/Home/bin/unpack200
+0        [Spawner] Appended argument /Users/nyholku/Library/Application Support/JWrapper-SampleApp/JWrapperTemp-1415077515-5-app/Contents/Home/bin/unpack200
+0        [Spawner] Appended argument /Users/nyholku/Library/Application Support/JWrapper-SampleApp/JWrapperTemp-1415077515-5-app/Contents/Home/lib/alt-rt.jar.p2
+1        [Spawner] Appended argument /Users/nyholku/Library/Application Support/JWrapper-SampleApp/JWrapperTemp-1415077515-5-app/Contents/Home/lib/alt-rt.jar
+0        Launch Error 13.
+0          [ExtractArchiveFile] ERROR: unpack200 (/Users/nyholku/Library/Application Support/JWrapper-SampleApp/JWrapperTemp-1415077515-5-app/Contents/Home/lib/alt-rt.jar) does not exist!

So even the out-of-the-box JWrapper on their own samppleapp fails on this machine. 因此,即使是他们自己的samppleapp上的开箱即用的JWrapper在这台机器上也会失败。

I conjecture the error 'Launch Error 13' is 'permission denied' because doing 'ls' on the 'unpack200' gives: 我猜想错误“启动错误13”是“权限被拒绝”,因为在“ unpack200”上执行“ ls”会给出:

-rw-r--r--  1 nyholku  staff  103216  4 Nov 07:05 /Users/nyholku/Library/Application Support/JWrapper-SampleApp/JWrapperTemp-1415077515-5-app/Contents/Home/bin/unpack200

Also it looks a bit suspect that (again conjecture based on the log) there apparently are three parameters ('[Spawner] Appended argument …') given to the 'unpack200' because it only takes two. 同样,似乎有点怀疑(再次基于对数猜想),显然给“ unpack200”提供了三个参数(“ [Spawner]附加参数…”),因为它只需要两个。 In fact trying to unpack (just to debug) from the command line works with the two last parameters but not with the three. 实际上,尝试从命令行解压缩(仅用于调试)对最后两个参数有效,但对三个不起作用。

I find it hard to believe that there would be this sort of bug in JWrapper so I must be doing something wrong or there is something wrong with my system. 我很难相信JWrapper中会出现这种错误,因此我必须做错了某些事情,或者我的系统出了点问题。 Maybe need to check disk permissions or something. 可能需要检查磁盘权限或其他内容。

Rebooted to my Maverick partition and everything worked! 重新启动到我的Maverick分区,一切正常!

Rebooted back to Mountain Lion and everything worked! 重新启动回山狮,一切正常!

My conclusion: some abortive attempts to compile/launch had left some garbage around that prevented JWrapper from working. 我的结论是:某些不合要求的编译/启动尝试使JWrapper无法正常工作。

Being a Mac user I'm not used to rebooting ;) and hence I did not try that! 作为Mac用户,我不习惯重新启动;),因此我没有尝试过!

Conjecture, which I was too late verify because I had rebooted: 我已经太晚了,因为我重新启动了,所以我猜想一下:

JWrapper uses the .dmg disk images on Mac and I may have not ejected or the eject failed when I did my test so maybe the JWrapper launcher thingy tried to load stuff from the wrong disk image … I've seen it often that on Mac OS even if the disk image is not visible on the Desktop you can still see it mounted in the '/Volumes' JWrapper在Mac上使用.dmg磁盘映像,并且当我进行测试时我可能没有弹出或弹出失败,因此JWrapper启动器可能试图从错误的磁盘映像中加载内容……我在Mac OS上经常看到这种情况即使磁盘映像在桌面上不可见,您仍然可以看到它已安装在“ /卷”中

Final note. 最后说明。 When I say everything worked I'm not implying that Java 8 works for me but now that the sample app works I think it is time to close this question. 当我说一切正常时,我并不是说Java 8对我有用,但是现在示例应用程序可以工作了,我认为是时候解决这个问题了。

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

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