All IntelliJ run configurations disappeared
Intellij IdeaIntellij Idea Problem Overview
After IntelliJ IDEA froze and was killed from the task manager, all the Run/Debug Configurations disappeared. I have tried invalidating caches, reloading files from disk, synchronizing and restarting, but nothing helped.
Intellij Idea Solutions
Solution 1 - Intellij Idea
You can try to restore your Run configuration using the Local History feature of IntelliJ IDEA.
If you are using .idea
directory based format, then your configurations will reside in workspace.xml
file under .idea
directory, invoke Local History dialog from the .idea directory right click menu in IDEA Project View, select the label some time before the crash and revert the old copy of workspace.xml
.
In case .ipr
file based format is used, your configurations will be stored in the <project>.iws
file in the project root which you can restore in a similar way.
If the configurations were Shared, they are stored in .idea\runConfigurations
directory as separate XML files or in the <project>.ipr
file (if old project format is used).
If the Local history is blank and you are in Windows, try Restore previous versions right clicking the workspace.xml
file or the <project>.iws
one in Windows Explorer.
Solution 2 - Intellij Idea
You can go to your main project and right click on it, select local history --> show history. Find some point in time where you think that system was stable (before crash) and click revert. This worked for me.
Solution 3 - Intellij Idea
To me, this frequently happened on switching branches. Turning off "restore workspace on branch switching" helps to prevent the run configurations from getting lost.
Solution 4 - Intellij Idea
Run configurations are stored in your project files. When IntelliJ (or your computer with IntelliJ running) crashes hard, the project files can become corrupted and unreadable. I don't know of a way to recover this unless you have your project files are backed up somewhere.
Solution 5 - Intellij Idea
Navigate to your project folder and check weather any .idea folder is created or not, if created copy your project and paste it other location ant try opening it; it will work.
Solution 6 - Intellij Idea
For every project in intellij there's a file created with all the configurations related to it.
Under the root directory of the project there's a hidden folder .idea in it is the workspace.xml with the configuration. workspace.xml is comprised of components one of which is responsible to hold the run/debug configurations.
If this file is getting corrupted it's difficult to restore these configurations if you don't have a backup of workspace.xml. to overcome it: 1. in intellij right click the workspace.xml file under project view and choose Local History -> Show History 2. if there's no history you can copy the component from a coworker with similar configurations. 3. backup in advance the workspace.xml and retrieve the RunManager component from it..
another good choice is to use the share option. under each project's definition there's a checkbox share
Marking this checkbox will extract the definition for this project to an external location: under the same .idea folder a new folder is being created runConfigurations and the configurations per project are being represented there in xml files.
The advantage of using share is that it can be copied and used for similar projects under other branched like QA and production
Solution 7 - Intellij Idea
I sometimes have the problem that all the run/debug configurations are not created from CMake after being lost. I solved this by just deleting the whone list of configurations from the workspace.xml (from .idea folder).
Solution 8 - Intellij Idea
This happened to me recently and I just restarted IntelliJ and they shared ones (in .run
) are now restored.
Solution 9 - Intellij Idea
In my case what happened was I did something that made IntelliJ recognize the project as a new application type, so it thought my old configuration was not valid for my project anymore and wasn't displaying it to me. I reverted my changes and the configuration appeared as an option again.
Solution 10 - Intellij Idea
Very annoying problem in Intellij Idea for many years.
It's quite often breaks because of broken (connection to?) Ant debugger, used to create run configs.
I was periodically searching for a solution, but no success. Then today after disappeared Run Config to display in panel I did inspect contents of workspace.xml. All the run configs were there.
And then it turns out to be 7+ years bug clue... Always spring out non-called Ant...
Happily, contents of workspace.xml in place with all your run config items, you can just
- disable infamous plugin Ant debugger,
- reload the project,
and all your run configs are displayed and available again))).
Happy to share with all of you the solution).