问题描述
我正在尝试将jWrapper与Java 8结合使用,但是我不知道如何设置JRE.
I'm trying to use jWrapper with Java 8, but I don't understand how to set up the JREs.
作为测试,我在JWrapper config .xml文件中指定了(我在Mac OS X 10.8.5上):
As a test I specified (I'm On Mac OS X 10.8.5) on my JWrapper config .xml file:
<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)
某些人显然已经设法使用Java 8,但我没有蜂能够找到任何详细信息,所以我正在寻找详细说明....
Some people apparently have managed to use Java 8 but I've not beeable to find any specifics, so I'm looking for a spelled out instructions….
更多信息
今天早上,我重命名了文件:
This morning I renamed the file:
/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/jar
到
/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/jar-orig
,然后看来JWrapper只是跳过了文件,构建完成了,一切似乎还好.
and it appears that JWrapper then just skips the file and the build completes andeverything seems ok.
但是,当我尝试启动生成的64位Mac OS X .app文件时,它失败了几十秒钟后没有错误消息.
However when I try to launch the resulting 64 bit Mac OS X .app file it failswithout an error message after some tens of seconds.
查看登录信息:
/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!
回到基础,我擦除了所有与JWrapper相关的内容,并从头开始:
Going back to basic I erased everything JWrapper related and started from scratch:
-下载的JWrapper下载的sampleapp下载的jre-17包
-downloaded JWrapper-downloaded sampleapp-downloaded 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
构建成功完成,但是.dmg中的64位Mac .app无法启动,日志显示:
the build finished successfully but the 64 bit Mac .app from the .dmg fails to launch and the log shows:
+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!
因此,即使是自己的samppleapp上的开箱即用的JWrapper在这台机器上也会失败.
So even the out-of-the-box JWrapper on their own samppleapp fails on this machine.
我猜想错误启动错误13"是权限被拒绝",因为在"unpack200"上执行"ls"会给出:
I conjecture the error 'Launch Error 13' is 'permission denied' because doing 'ls' on the 'unpack200' gives:
-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
也似乎有点怀疑(再次基于对数进行猜想),显然给"unpack200"提供了三个参数("[Spawner]附加参数…"),因为它只需要两个.实际上,尝试从命令行解压缩(仅用于调试)对最后两个参数有效,但对三个不起作用.
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. In fact trying to unpack (just to debug) from the command line works with the two last parameters but not with the three.
我很难相信JWrapper中会出现这种错误,因此我必须做错了某些事情,或者我的系统出了点问题.可能需要检查磁盘权限或其他内容.
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. Maybe need to check disk permissions or something.
推荐答案
重新启动到我的Maverick分区,一切正常!
Rebooted to my Maverick partition and everything worked!
重新启动到Mountain Lion,一切正常!
Rebooted back to Mountain Lion and everything worked!
我的结论是:某些不合要求的编译/启动尝试使JWrapper无法正常工作.
My conclusion: some abortive attempts to compile/launch had left some garbage around that prevented JWrapper from working.
作为Mac用户,我不习惯重新启动;),因此我没有尝试过!
Being a Mac user I'm not used to rebooting ;) and hence I did not try that!
猜想,我为时已晚,因为我重新启动了:
Conjecture, which I was too late verify because I had rebooted:
JWrapper在Mac上使用.dmg磁盘映像,并且在进行测试时我可能没有弹出或弹出失败,因此JWrapper启动器可能试图从错误的磁盘映像中加载内容...我经常看到在Mac OS上,即使该磁盘映像在桌面上不可见,您仍然可以看到它已安装在"/卷"中
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'
最后的笔记.当我说一切正常时,我并不是说Java 8对我有用,但是现在示例应用程序可以工作了,我认为是时候解决这个问题了.
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.
这篇关于JWrapper示例应用程序无法在Mac OS X 10.8.5上启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!