If you need to clear the IntelliJ IDEA caches to resolve issues, you can safely delete the caches folder without opening the IDE.
Below are the steps to delete the folder using both Cygwin and BAT (cmd).
Using Cygwin:
-
Open Cygwin.
-
Run the following command to remove the caches folder, converting the Windows path to Cygwin's format:
rm -rf $(cygpath "$LOCALAPPDATA")/JetBrains/IntelliJIdea<Version>/caches
- Replace
<Version>
with your IntelliJ IDEA version (e.g.,2022.3
). - This command converts
%LOCALAPPDATA%
to a Cygwin-friendly path usingcygpath
and deletes thecaches
folder.
- Replace
Using BAT (cmd):
-
Open Command Prompt or create a BAT script.
-
Run the following command to delete the caches folder:
rmdir /s /q "%LOCALAPPDATA%\JetBrains\IntelliJIdea<Version>\caches"
- Replace
<Version>
with the correct version number for IntelliJ IDEA. - This command uses the Windows
%LOCALAPPDATA%
environment variable to locate and remove the caches folder.
- Replace
After running these commands, the caches folder will be deleted, and IntelliJ IDEA will recreate it the next time the IDE is launched.
This is useful for clearing old cache files or troubleshooting issues with configurations.