idea.config.path is invalid

电脑装的 Win8,由于装系统时windows live里的名字是中文,导致系统一开始的用户名是中文,具体表现就是C盘users下的当前用户文件夹名字成了中文。虽预知到日后会带来各种不适,一开始还是采用各种方法“逃避”,昨天遇一状况,狠下心,决定把这个文件夹名改成英文,以绝后患。这个教程网上有很多,推荐个图文并茂的:这里

改完之后,引发了一系列连锁反应。我的 Intellij Idea 和 PyCharm 无法启动了,显示错误:idea.config.path is invalid。程序员的特质就是:来一个问题,解决一个。

经过查找网页,自己思考和实践,终于搞定。只需把各工具的安装路径下的bin文件夹中的 idea.properties 配置文件打开修改。里面所有带有 ${user.home} 的路径全部使用绝对路径,并取消该行注释。举例:

我的 idea.properties 原先如下(需修改部分):

#---------------------------------------------------------------------
# Uncomment this option if you want to customize path to IDE config folder. Make sure you're using forward slashes
#---------------------------------------------------------------------
#idea.config.path=${user.home}/.IntelliJIdea/config
#---------------------------------------------------------------------
# Uncomment this option if you want to customize path to IDE system folder. Make sure you're using forward slashes
#---------------------------------------------------------------------
#idea.system.path=${user.home}/.IntelliJIdea/system
#---------------------------------------------------------------------
# Uncomment this option if you want to customize path to user installed plugins folder. Make sure you're using forward slashes
#---------------------------------------------------------------------
idea.plugins.path=${user.home}/.IntelliJIdea/config/plugins
#---------------------------------------------------------------------
# Uncomment this option if you want to customize path to IDE logs folder. Make sure you're using forward slashes.
#---------------------------------------------------------------------
#idea.log.path=${user.home}/.IntelliJIdea/system/log

修改为:

#---------------------------------------------------------------------
# Uncomment this option if you want to customize path to IDE config folder. Make sure you're using forward slashes
#---------------------------------------------------------------------
idea.config.path=C:/Users/Joshua/.IntelliJIdea12/config
#---------------------------------------------------------------------
# Uncomment this option if you want to customize path to IDE system folder. Make sure you're using forward slashes
#---------------------------------------------------------------------
idea.system.path=C:/Users/Joshua/.IntelliJIdea12/system
#---------------------------------------------------------------------
# Uncomment this option if you want to customize path to user installed plugins folder. Make sure you're using forward slashes
#---------------------------------------------------------------------
idea.plugins.path=C:/Users/Joshua/.IntelliJIdea12/config/plugins
#---------------------------------------------------------------------
# Uncomment this option if you want to customize path to IDE logs folder. Make sure you're using forward slashes.
#---------------------------------------------------------------------
idea.log.path=C:/Users/Joshua/.IntelliJIdea12/system/log

这样就能启动。注:我把系统的用户文件夹名改为了Joshua,所以配置相应都改成以上。

顺便一提,启动 PyCharm 后发现,python 自带的类库提示未安装,PyCharm 会有自动纠错,提示重新安装,选择这个之后,就会自动修复,一切OK。