'How to clear the IntelliJ project index?
I've run into trouble that makes me suspect there is a bad index file that needs to be cleared. The symptoms are:
- Cmd+N will only find a subset of classes in the project
- Trying to run JUnit test on a package won't find the test classes in that package.
Before suspecting a bad index I reinstalled IntelliJ 8.1.3, then I removed and re-checked out the source code. It didn't help. Only after checking out the code into a different folder did IntelliJ start working correctly again, but only for the new project folder. The old project folder is still infected.
So where is that index and how do I clear it?
Solution 1:[1]
For mac you can just hover over the project in recent project list, and click fn + del. that's all.
Solution 2:[2]
This happens to me occasionally. Under your home directory (~ on Linux/Unix, C:\Users\LoginName under Vista/Win7, C:\Documents and Settings... under XP) you will find a directory called .IntelijIdea8x. You will want to close down IntelliJ and delete a couple of key directories, most probably:
- system/caches
- possibly system/js_caches;
- possibly system/jsp_caches (although probably not in this case).
Restart it and that should fix it.
Solution 3:[3]
You could do the following now via IDE to invalidate cache:
From the main menu, select File | Invalidate Caches.
In the Invalidate Caches dialog, Click
Invalidate and Restart.
If you click Just restart, cache files etc. won't be deleted.
In case if the above did not solve your problem, proceed with the manual way.
Locate the following Location and hard delete it.
~/Library/Caches/IntelliJIDEA{version}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Rajan Twanabashu |
| Solution 2 | cletus |
| Solution 3 | Du-Lacoste |
