【IDEA】MAC 修改".vmoptions"导致 IDEA 无法启动 解决方案

Idea Version:  “2019.3”

Question:

在IDEA的“Help | Edit Custom VM Options”菜单中修改了“.vmoptions”配置,(改错了文件路径),重启多次,软件一直打不开。即便卸载重装软件,问题依然复现。

 

一、".vmoptions" 官方描述

Configuring JVM options and platform properties 通过学习上述文档,发现

1)IDEA中“.vmoptions”文件有2份

VM options are loaded from the IDE_HOME\bin\<product>[bits][.exe].vmoptions file or from the copy 
of this file in the config directory (if it exists). Please note that .vmoptions 
file from the config directory has the priority over the original file in the bin directory.

VM选项是从“IDE_HOME\bin\<product>[bits][.exe].vmoptions”文件 或 config目录中.vmoptions的副本中加载的。注意,config目录中的.vmoptions文件执行优先级高于Idea安装路径下bin目录中的原始文件。

 

2)“Help | Edit Custom VM Options”菜单编辑的是Config下的副本文件

Mac OS X Specifics
Don't edit .vmoptions and .properties files directly, it will violate the application signature, 
always make a copy of the files under IDE configuration directory and edit the copy instead. See this answer for details. 
The original file is located in /Applications/<Product>.app/Contents/bin folder (/Applications/<Product>.app/bin for older IDE versions).

针对mac的说明:
不要直接编辑".vmoptions"和".properties"文件(原始文件位于/Applications/<Product>.app/Contents/bin文件夹,对于较早的IDE版本,为/Applications/<Product>.app/bin),这会违反应用程序签名,请始终在IDE配置目录下创建文件的副本,然后编辑该副本。即在 “Help | Edit Custom VM Options”菜单中执行编辑。

 

3)Mac OS Config副本文件地址

Configuration (idea.config.path):
~/Library/Preferences/<PRODUCT><VERSION>

综上可知,即便重装IDEA,软件也打不开,在于“Help | Edit Custom VM Options”编辑的是“~/Library/Preferences/<PRODUCT><VERSION>” 这里的副本。

 

二、删除.vmoptions的“副本文件”

如上,“/User/用户名/Library/Preferences/”路径下,并未发现“IntelliJIdea”相关文件。。。

考虑隐藏文件的原因,通过Finder查看,目录存在:

删除其中的“.vmoptions”文件,重启即可打开IDEA。

 

评论 42
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值