微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

macos – LSOpenURLsWithRole()失败,错误-10810

下载并安装了Airstream应用程序,当我启动它时没有任何反应.在终端输出

$open /opt/homebrew-cask/Caskroom/airstream/latest/Airstream.app
LSOpenURLsWithRole() Failed with error -10810 for the file /opt/homebrew-cask/Caskroom/airstream/latest/Airstream.app.

这似乎是一个Java存根/启动器

$file /opt/homebrew-cask/Caskroom/airstream/latest/Airstream.app/Contents/MacOS/JavaApplicationStub 
/opt/homebrew-cask/Caskroom/airstream/latest/Airstream.app/Contents/MacOS/JavaApplicationStub: Mach-O universal binary with 2 architectures
/opt/homebrew-cask/Caskroom/airstream/latest/Airstream.app/Contents/MacOS/JavaApplicationStub (for architecture i386):  Mach-O executable i386
/opt/homebrew-cask/Caskroom/airstream/latest/Airstream.app/Contents/MacOS/JavaApplicationStub (for architecture x86_64):    Mach-O 64-bit executable x86_64
Lees-MacBook-Pro:Casks hanxue$oprn /opt/homebrew-cask/Caskroom/airstream/latest/Airstream.app/Contents/MacOS/JavaApplicationStub 

当我手动运行它

$open /opt/homebrew-cask/Caskroom/airstream/latest/Airstream.app/Contents/MacOS/JavaApplicationStub 

这是结果

/opt/homebrew-cask/Caskroom/airstream/latest/Airstream.app/Contents/MacOS/JavaApplicationStub ; exit;
$/opt/homebrew-cask/Caskroom/airstream/latest/Airstream.app/Contents/MacOS/JavaApplicationStub ; exit;
JavaVM: Failed to load JVM: /Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home/bundle/Libraries/libserver.dylib
JavaVM: Failed to load JVM: /Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home/bundle/Libraries/libserver.dylib
JavaVM FATAL: Failed to load the jvm library.
[JavaAppLauncher Error] JNI_CreateJavaVM() Failed, error: -1
logout

Java已正确安装,我还有其他Java应用程序正常运行.我该如何解决这个错误

解决方法:

发生此错误是因为JVM无法启动 – Java应用程序本身已经硬编码以加载libserver.dylib.此文件适用于Java 1.6及更早版本,但不适用于Java 1.7及更高版本.

解决方法

从libjvm.dylib到libserver.dylib创建目录结构和符号链接

$sudo mkdir -p /Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home/bundle/Libraries/
$sudo ln -s /Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home/jre/lib/server/libjvm.dylib /Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home/bundle/Libraries/libserver.dylib

请注意,这是特定于JDK 1.8.0更新5.对于将来的版本,需要在三个位置更新路径.

修改Java应用程序的代码,使其不会查找libserver.dylib.你真的不应该硬编码JVM的路径.相反,如果需要OSX中的JVM路径,请使用/usr/libexec / java_home.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐