gpt4 book ai didi

java - Android Studio 无法启动,libjli.dylib 太短

转载 作者:行者123 更新时间:2023-11-30 06:48:36 27 4
gpt4 key购买 nike

无法打开 Android Studio 3.0 Preview,我在同一台机器上运行 Android Studio 2.3,安装了 Java 1.6 和 Java 1.8,JAVA_HOME 配置为 1.8 版本。这个新的 Android Studio 版本仍然打不开。

试图直接从studio文件打开它,我得到了以下错误:

allVms required 1.8*,1.8+
Cannot load JVM bundle: Error Domain=NSCocoaErrorDomain Code=3587 "dlopen_preflight(/Applications/Android Studio 3.0 Preview.app/Contents/jre/jdk/Contents/MacOS/libjli.dylib): no suitable image found. Did find:
/Applications/Android Studio 3.0 Preview.app/Contents/jre/jdk/Contents/MacOS/libjli.dylib: file too short
/Applications/Android Studio 3.0 Preview.app/Contents/jre/jdk/Contents/MacOS/libjli.dylib: file too short" UserInfo={NSLocalizedFailureReason=The bundle is damaged or missing necessary resources., NSLocalizedRecoverySuggestion=Try reinstalling the bundle., NSFilePath=/Applications/Android Studio 3.0 Preview.app/Contents/jre/jdk/Contents/MacOS/libjli.dylib, NSDebugDescription=dlopen_preflight(/Applications/Android Studio 3.0 Preview.app/Contents/jre/jdk/Contents/MacOS/libjli.dylib): no suitable image found. Did find:
/Applications/Android Studio 3.0 Preview.app/Contents/jre/jdk/Contents/MacOS/libjli.dylib: file too short
/Applications/Android Studio 3.0 Preview.app/Contents/jre/jdk/Contents/MacOS/libjli.dylib: file too short, NSBundlePath=/Applications/Android Studio 3.0 Preview.app/Contents/jre/jdk, NSLocalizedDescription=The bundle “OpenJDK 8” couldn’t be loaded because it is damaged or missing necessary resources.}

仔细观察这一行:

libjli.dylib: file too short, NSBundlePath=/Applications/Android Studio 3.0 Preview.app/Contents/jre/jdk, NSLocalizedDescription=The bundle “OpenJDK 8” couldn’t be loaded because it is damaged or missing necessary resources.}

我试着发现捆绑的 JDK 有问题,看起来不错,下载的存档没有问题。有人遇到过这样的事情吗?

最佳答案

当我发现问题时,我正要发布问题。

对我来说,问题是 MacOS 文件夹中的 libjli.dylib 文件,它不是文件,而是指向真实文件的符号链接(symbolic link),但是当我解压它时,它失去了作为符号链接(symbolic link)的属性,变成了一个空文件。删除以下文件,并创建一个新的符号链接(symbolic link)解决了这个问题。

/Applications/Android Studio 3.0 Preview.app/Contents/jre/jdk/Contents/MacOS/libjli.dylib

这个 ^ 链接到这个:

/Applications/Android Studio 3.0 Preview.app/Contents/jre/jdk/Contents/Home/jre/lib/jli/libjli.dylib

鉴于您的 Android Studio 应用程序位置是 /Applications/Android Studio 3.0 Preview.app 和我一样,以下命令为我解决了这个问题:

首先删除:

rm /Applications/Android\ Studio\ 3.0\ Preview.app/Contents/jre/jdk/Contents/MacOS/libjli.dylib

然后创建一个新链接:

ln -s /Applications/Android\ Studio\ 3.0\ Preview.app/Contents/jre/jdk/Contents/Home/jre/lib/jli/libjli.dylib /Applications/Android\ Studio\ 3.0\ Preview.app/Contents/jre/jdk/Contents/MacOS/libjli.dylib

只需照常打开 Android Studio

关于java - Android Studio 无法启动,libjli.dylib 太短,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44038264/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com