IDEA指定系统目录和配置目录

1,741 阅读1分钟

IDEA安装后会默认将C:\Users\用户\AppData\Local\JetBrains\IntelliJIdea*作为系统目录,将C:\Users\用户\AppData\Roaming\JetBrains\IntelliJIdea*作为配置目录。在使用IDEA的过程中,这两个目录会不断占用C盘更多空间,所以可以重新指定非C盘的目录为系统目录和配置目录以避免这个问题,步骤如下:

  • 创建自定义的系统目录D:\workspace\IDEA\system 和配置目录D:\workspace\IDEA\config
  • ‪IDEA安装目录\bin\idea.properties 配置如下内容:
#---------------------------------------------------------------------
# Uncomment this option if you want to customize a path to the settings directory.
#---------------------------------------------------------------------
# idea.config.path=${user.home}/.IntelliJIdea/config
idea.config.path=D:/workspace/IDEA/config

#---------------------------------------------------------------------
# Uncomment this option if you want to customize a path to the caches directory.
#---------------------------------------------------------------------
# idea.system.path=${user.home}/.IntelliJIdea/system
idea.system.path=D:/workspace/IDEA/system

#---------------------------------------------------------------------
# Uncomment this option if you want to customize a path to the user-installed plugins directory.
#---------------------------------------------------------------------
# idea.plugins.path=${idea.config.path}/plugins
idea.plugins.path=D:/workspace/IDEA/config/plugins

#---------------------------------------------------------------------
# Uncomment this option if you want to customize a path to the logs directory.
#---------------------------------------------------------------------
# idea.log.path=${idea.system.path}/log
idea.log.path=D:/workspace/IDEA/system/log
  • 将默认目录的内容复制到自定义的目录中
  • 重新启动IDEA即可