1. 程式人生 > 程式設計 >IntelliJ Idea2017如何修改快取檔案的路徑

IntelliJ Idea2017如何修改快取檔案的路徑

IDEA的快取資料夾.IntelliJIdea2017.1,存放著IDEA的破解密碼,各個專案的快取,預設是在C盤的使用者目錄下,目前有1.5G大小。現在想要把它從C盤移出。

IntelliJ Idea2017如何修改快取檔案的路徑

在IDEA的安裝路徑下中,進入bin目錄後找到屬性檔案: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=${idea.config.path}/plugins

需要注意,在IDEA2017中,預設這些配置是註釋掉的,我在這可吃了大虧,沒想到配置沒有生效的原因是如此簡單。

更改配置檔案如下:

#---------------------------------------------------------------------
# Uncomment this option if you want to customize path to IDE config folder. Make sure you're using forward slashes.
#---------------------------------------------------------------------
idea.config.path=E:/jiashubing/.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=E:/jiashubing/.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=${idea.config.path}/plugins

更改了以後重啟IDEA,會彈出如下介面Complete Installation,選擇Previous version

IntelliJ Idea2017如何修改快取檔案的路徑

此時,在目錄下生成了一個.IntelliJIdea檔案

IntelliJ Idea2017如何修改快取檔案的路徑

此時把.IntelliJIdea2017.1刪除了也可以,原來的專案也都能找得到

PS:初始快取資料夾.IntelliJIdea2017.1的來歷,之前安裝的是IDEA2015,那時的快取檔案是.IntelliJIdea,後來將IDEA2015升級成了IDE2017,在同一個目錄下生成了這個.IntelliJIdea2017.1資料夾。可能是IDEA內部的某種設定,如果檔案中已經存在了.IntelliJIdea檔案,就要在後面增加版本號字尾。

以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支援我們。