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.
In the same menu as the picture above 1 Click main toolbar then toolbar run actions. 2 At the "Toolbar Run Actions" leve, click the + button and "add action". 3 In the new popup, choose the "main menu" folder then the "run" folder. 4 Click on the "Run" icon and click ok.
By default, it is disabled, and IntelliJ IDEA stores run configuration settings in . idea/workspace. xml.
Open the Run/Debug Configuration dialog in one of the following ways: Select Run | Edit Configurations from the main menu. With the Navigation bar visible (View | Appearance | Navigation Bar), choose Edit Configurations from the run/debug configuration selector. Press Alt+Shift+F10 and then press 0 .
These configrations are located in . metadata/. plugins/org.
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.
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.
To me, this frequently happened on switching branches. Turning off "restore workspace on branch switching" helps to prevent the run configurations from getting lost.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With