我正在尝试将jWrapper与Java 8一起使用,但我不明白如何设置JRE。
作为我在JWrapper config .xml文件中指定的测试(我在Mac OS X 10.8.5上):
<Mac64JRE>/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/</Mac64JRE>
但这样的结果是这样的例外:
[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,但我不是蜜蜂 能够找到任何细节,所以我正在寻找一个明确的说明......
编辑:更多信息
今天早上我重命名了文件:
/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只是跳过文件并且构建完成了 一切似乎都好。
然而,当我尝试启动生成的64位Mac OS X .app文件时,它失败了 几十秒后没有错误信息。
查看登录信息:
/Users/nyholku/Library/Application Support/JWrapper-MyApp/logs
我发现启动失败了:
+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相关的所有内容并从头开始:
- 下载JWrapper -downloaded sampleapp -downloaded jre-17 pack
将它们全部放入一个目录中 执行:
java -Xmx2048m -jar jwrapper-00031607960.jar sampleapp / jwrap
构建成功完成,但.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!
所以即使是自己的samppleapp上的开箱即用的JWrapper也无法在这台机器上运行。
我推测错误'启动错误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
同样看起来有点怀疑(基于日志再次推测)显然有三个参数('[Spawner] Appended argument ...')给'unpack200',因为它只需要两个。实际上,尝试从命令行解压缩(仅用于调试)可以使用最后两个参数,但不能使用三个参数。
我发现很难相信JWrapper会出现这种错误,所以我必须做错事或者我的系统出了问题。也许需要检查磁盘权限或其他东西。
答案 0 :(得分:2)
重新启动到我的Maverick分区,一切正常!
重新启动回Mountain Lion,一切正常!
我的结论:编译/启动的一些失败尝试留下了一些垃圾,阻止了JWrapper工作。
作为Mac用户,我不习惯重启;)因此我没有尝试过!
猜想,我太迟了,因为我重新启动了验证:
JWrapper使用Mac上的.dmg磁盘映像,当我进行测试时,我可能没有弹出或弹出失败,所以JWrapper发射器可能试图从错误的磁盘映像加载东西......我已经看过了通常在Mac OS上,即使桌面上看不到磁盘映像,您仍然可以看到它已安装在&#39; / Volumes&#39;
最后的说明。当我说一切正常时,我并不是说暗示Java 8适合我,但现在示例应用程序正常运行,我认为是时候关闭这个问题。