Mac Goland 无法启动的解决方法

转自https://www.jianshu.com/p/3ea0959c3e7f

仅做个人备份

第一步:在访达中打开 软件源文件

打开 Finder(访达) --> Applications(应用程序) --> Goland(idea) --> Show Package Contents(显示包内容)

第二步:运行启动文件

按下图方式找到启动文件:Contents-->MacO-->goland, 双击运行

Mac Goland 无法启动的解决方法_第1张图片

双击执行文件后,终端会显示具体错误信息:

~ » /Applications/GoLand.app/Contents/MacOS/goland ; exit;
2020-11-30 23:48:34.949 goland[13653:608700] allVms required 1.8*,1.8+
2020-11-30 23:48:34.951 goland[13653:608705] Current Directory: /Users/corey
2020-11-30 23:48:34.951 goland[13653:608705] Value of GOLAND_VM_OPTIONS is (null)
2020-11-30 23:48:34.951 goland[13653:608705] Processing VMOptions file at /Users/corey/Library/Application Support/JetBrains/GoLand2020.2/goland.vmoptions
2020-11-30 23:48:34.951 goland[13653:608705] 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 : /Documents/other/ideaConf/jetbrains-agent.jar
Error occurred during initialization of VM
agent library failed to init: instrument

[Process completed]

报错指出 系统文件~/Library/Application Support/JetBrains/GoLand2020.2/goland.vmoptions 在加载-javaagent:/Documents/other/ideaConf/jetbrains-agent.jar 文件时出了问题。

直接打开该系统文件 vim ~/Library/Application Support/JetBrains/GoLand2020.2/goland.vmoptions, 内容如下:

-Xms128m
-Xmx2048m
-XX:ReservedCodeCacheSize=240m
-XX:+UseCompressedOops
-Dfile.encoding=UTF-8
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-Djdk.http.auth.tunneling.disabledSchemes=""
-XX:+HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow

-XX:ErrorFile=$USER_HOME/java_error_in_goland_%p.log
-XX:HeapDumpPath=$USER_HOME/java_error_in_goland.hprof
-javaagent:/Documents/other/ideaConf/jetbrains-agent.jar

一方排查以后,自己电脑中-javaagent:/Documents/other/ideaConf/jetbrains-agent.jar 文件不存在了,软件加载不到,便启动失败。

解决方法

把该行注释掉,或者直接删除

-Xms128m
-Xmx2048m
-XX:ReservedCodeCacheSize=240m
-XX:+UseCompressedOops
-Dfile.encoding=UTF-8
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-Djdk.http.auth.tunneling.disabledSchemes=""
-XX:+HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow

-XX:ErrorFile=$USER_HOME/java_error_in_goland_%p.log
-XX:HeapDumpPath=$USER_HOME/java_error_in_goland.hprof
# -javaagent:/Documents/other/ideaConf/jetbrains-agent.jar

保存文件后重启goland,可以正常启动了

你可能感兴趣的:(其他,macos)