MacBook系统升级导致idea无法打开

1 背景

MacBook的MacOS系统升级之后,之前安装的idea无法打开了。idea卸载重装仍然无法打开。

2 原因排查

2.1 寻找报错原因

为了了解具体的报错原因,通过"访达-应用程序"找到"IntelliJ IDEA",然后右击打开"显示包内容"选项进入IntelliJ IDEA的安装目录,通过"Contents-MacOS" 找到名称为"idea"的文件启动idea。在控制台能看到idea的启动过程和报错信息。具体如下。

bash 复制代码
The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
mynamedembp:~ myname$ /Applications/IntelliJ\ IDEA.app/Contents/MacOS/idea ; exit;
2024-04-21 18:14:10.101 idea[4108:118253] allVms required 1.8*,1.8+
2024-04-21 18:14:10.104 idea[4108:118259] Value of IDEA_VM_OPTIONS is (null)
2024-04-21 18:14:10.104 idea[4108:118259] Processing VMOptions file at /Users/myname/Library/Preferences/IntelliJIdea2019.3/idea.vmoptions
2024-04-21 18:14:10.104 idea[4108:118259] Done
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
Error opening zip file or JAR manifest missing : /IT/soft/IT/idea/2019/jetbrains-agent/jetbrains-agent.jar
Error occurred during initialization of VM
agent library failed to init: instrument
logout

Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

由上可知,关键信息为

Error opening zip file or JAR manifest missing : /IT/soft/IT/idea/2019/jetbrains-agent/jetbrains-agent.jar

2.2 原因分析

由报错信息可知,无法解析 jetbrains-agent.jar,或者通过该路径找不到 jetbrains-agent.jar。

MacOS系统升级后,idea的配置文件被保留了下来。idea卸载之后,其配置文件(/Users/myname/Library/Preferences/IntelliJIdea2019.3/idea.vmoptions)不会被删除,重新安装之后,会依旧使用原来的配置文件,且信息不变。

而上述idea.vmoptions文件中配置了jetbrains-agent.jar的位置信息。并且在MacOS系统升级后,由于jetbrains-agent.jar所在的文件夹位置被自动调整了,导致idea.vmoptions文件中存储的jetbrains-agent.jar位置不正确(存储的为升级前文件所在的位置),从而导致通过**配置的路径找不到 jetbrains-agent.jar。**进而导致无法打开idea。

备注:默认情况下"Library"文件是被隐藏的,可以通过 "shift(即向上的大箭头)+command+."显示被隐藏的文件夹。

3 问题解决

重新设置 /Users/myname/Library/Preferences/IntelliJIdea2019.3/idea.vmoptions 文件中的 jetbrains-agent.jar 的位置信息即可。

相关推荐
大猫和小黄3 天前
IDEA终极配置指南:打造你的极速开发利器
intellij-idea
zhong liu bin4 天前
maven【maven】技术详解
java·ide·python·spring·maven·intellij-idea
boy快快长大5 天前
【IntelliJ IDEA】插件分享
java·ide·intellij-idea
2501_927539305 天前
JetBrains 2025 全家桶 11合1 Windows直装(含 IDEA PyCharm、WebStorm、DataSpell、DataGrip等)
ide·pycharm·intellij-idea·webstorm
翻斗花园刘大胆5 天前
JavaSE之String 与 StringBuilder 全面解析(附实例代码)
java·开发语言·jvm·git·java-ee·intellij-idea·html5
珹洺5 天前
Java-Spring入门指南(二)利用IDEA手把手教你如何创建第一个Spring系统
java·spring·intellij-idea
偏执网友5 天前
idea上传本地项目代码到Gitee仓库教程
java·gitee·intellij-idea
2501_928094656 天前
JetBrains 2025 全家桶 11合1 Windows直装(含 IDEA PyCharm、WebStorm、DataSpell、DataGrip等
pycharm·intellij-idea·webstorm
Yeats_Liao6 天前
IDEA Spring属性注解依赖注入的警告 Field injection is not recommended 异常解决方案
java·spring·intellij-idea
ItKnow6 天前
IntelliJ IDEA2025+启动项目提示 Failed to instantiate SLF4J LoggerFactory
java·单元测试·intellij-idea