本文使用 Idea2024
Idea 會將一些配置默認緩存在C盤,使用久了會占用大量空間(本人的Idea占用了將近5個G,以至于不得不進行遷移)
緩存目錄主要涉及以下四個目錄,四個目錄可以分為兩組,每組目錄必須一起調整
配置名 | 默認路徑 |
---|---|
idea.config.path | C:\Users\JohnS\AppData\Roaming\JetBrains\IntelliJIdea2024.1 |
idea.system.path | C:\Users\JohnS\AppData\Local\JetBrains\IntelliJIdea2024.1 |
idea.plugins.path | C:\Users\JohnS\AppData\Roaming\JetBrains\IntelliJIdea2024.1\plugins |
idea.log.path | C:\Users\JohnS\AppData\Local\JetBrains\IntelliJIdea2024.1\log |
打開 ${idea.home.path}/bin/idea.properties
配置文件,修改相關參數的路徑
#---------------------------------------------------------------------
# Uncomment this option if you want to customize a path to the settings directory.
#---------------------------------------------------------------------
idea.config.path=D:/idea2024/config#---------------------------------------------------------------------
# Uncomment this option if you want to customize a path to the caches directory.
#---------------------------------------------------------------------
idea.system.path=D:/idea2024/system#---------------------------------------------------------------------
# Uncomment this option if you want to customize a path to the user-installed plugins directory.
#---------------------------------------------------------------------
idea.plugins.path=${idea.config.path}/plugins#---------------------------------------------------------------------
# Uncomment this option if you want to customize a path to the logs directory.
#---------------------------------------------------------------------
idea.log.path=${idea.system.path}/log
將默認路徑中的文件復制至新路徑,然后重啟 Idea,原來的配置不會丟失。
然后就可以刪除默認路徑中的文件啦,釋放大量空間。
不同的版本可以參考官網文檔:
https://www.jetbrains.com/help/idea/2024.1/directories-used-by-the-ide-to-store-settings-caches-plugins-and-logs.html#config-directory