Every once in a while, you get into trouble, serious trouble, and the only solution is to clear out all your stuff and start again.
This recently happened to me when my IntelliJ started misbehaving. I didn't have time to fix it, so I just bore with it, but now it's time to fix it.
In order to remove all the settings of IntelliJ (That I thought were the problem), I found the link at [2] via [1] which helped a lot!
And since I'm using a MacBook M2, perhaps I should write them down here:
Plugins (idea.plugins.path): ~/Library/Application Support/JetBrains/IntelliJIdea2022.2/plugins
System (idea.system.path): ~/Library/Caches/JetBrains/IntelliJIdea2022.2
Logs (idea.log.path): ~/Library/Logs/JetBrains/IntelliJIdea2022.2
Above are the directories that you should either remove or move somewhere safe (in case you want to reuse settings, like for example database connection properties).
Removing IntelliJ settings from a Project
So, if I've done the above, good idea to also remove the settings that are project specific.
This should be as simple as finding the ".idea" directory in your project and removing it entirely. But an alternate way is just removing all unversioned files and changes from your version management system, that'll work too.
I found a good way of doing it using the Git versioning system and described it in [3].
Then what?
Well, unfortunately, after all that it's time to reimport your project into IntelliJ and configuring all your IntelliJ settings again.
Preferably by hand, to prevent the same problem that torpedoed your Intellij from happening again.
References
- [1] StackOverflow - In IntelliJ on OS X, how do you clear out all global setting info, licensing etc. (external to any project)
- https://stackoverflow.com/questions/2774315/in-intellij-on-os-x-how-do-you-clear-out-all-global-setting-info-licensing-etc
- [2] IntelliJ Support - Directories used by the IDE to store settings, caches, plugins and logs
- https://intellij-support.jetbrains.com/hc/en-us/articles/206544519-Directories-used-by-the-IDE-to-store-settings-caches-plugins-and-logs
- [3] Git: Adding your own commands
- https://randomthoughtsonjavaprogramming.blogspot.com/2024/10/git-adding-your-own-commands.html