所有 IntelliJ 运行配置都消失了
IntelliJ IDEA 冻结并从任务管理器中终止后,所有运行/调试配置都消失了。我尝试过使缓存无效、从磁盘重新加载文件、同步和重新启动,但没有任何帮助。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(13)
对我来说,这种情况经常发生在切换分支时。关闭“在分支切换时恢复工作区”有助于防止运行配置丢失。
编辑:不确定它是否真的有影响,它似乎有时仍然会发生在我身上,但可能不那么频繁。我将把它留在这里,因为答案已经有一些赞成票,所以也许这就是某人的解决方案...
编辑 #2: 我们现在也主要切换到提交的运行配置。让每个人的生活变得更轻松。从历史上看,我们在这方面遇到过麻烦,但现在似乎已经基本解决,因为我们已经使用此设置运行了几个月,到目前为止还没有出现任何问题。
To me, this frequently happened on switching branches. Turning off "restore workspace on branch switching" helps to prevent the run configurations from getting lost.
Edit: Not sure if it actually has an impact, it still seems to happen to me sometimes, maybe less frequently though. I'll leave it here since the answer already has some upvotes, so maybe this was the solution for someone...
Edit #2: We've also switched mostly to committed run configurations now. Makes life easier for everyone. Historically we've had trouble with this, but seems it's now mostly resolved since we're running with this setup for a couple of months and no issues so far.
您可以转到您的主项目并右键单击它,选择本地历史记录 -->显示历史。找到您认为系统稳定的某个时间点(崩溃之前),然后单击“恢复”。这对我有用。
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.
就我而言,我不小心按下了
Alt + Home
并且这个栏消失了,这个组合为我切换了 IDEA 窗口顶部的运行栏。这是我在该键上绑定的操作的屏幕。我希望它能有所帮助
In my case, i've accidentally pressed
Alt + Home
and this bar disappeared, this combination toggles run bar at the top of IDEA window for me.Here the screen with my bound actions on this keys. I hope it should help
对于 intellij 中的每个项目,都会创建一个包含与其相关的所有配置的文件。
项目根目录下有一个隐藏文件夹.idea,里面是workspace.xml和配置。 workspace.xml 由组件组成,其中之一负责保存运行/调试配置。
如果此文件损坏,并且您没有workspace.xml 的备份,则很难恢复这些配置。克服它:
1.在intellij中右键单击项目视图下的workspace.xml文件并选择Local History ->显示历史
2.如果没有历史记录,您可以从具有类似配置的同事那里复制该组件。
3.提前备份workspace.xml并从中检索RunManager组件。
另一个不错的选择是使用共享选项。
在每个项目的定义下都有一个复选框 share
标记此复选框将将此项目的定义提取到外部位置:
在同一个 .idea 文件夹下,将创建一个新文件夹 runConfigurations,并且每个项目的配置都以 xml 文件形式表示。
使用共享的优点是它可以复制并用于其他分支(例如 QA 和生产)下的类似项目
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
最近发生在我身上,我刚刚重新启动 IntelliJ,他们共享的(在
.run
中)现在已恢复。This happened to me recently and I just restarted IntelliJ and they shared ones (in
.run
) are now restored.就我而言,发生的事情是我做了一些事情,使 IntelliJ 将该项目识别为新的应用程序类型,因此它认为我的旧配置不再对我的项目有效,并且不会向我显示它。我恢复了更改,配置再次作为选项出现。
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.
运行配置存储在您的项目文件中。当 IntelliJ(或运行 IntelliJ 的计算机)严重崩溃时,项目文件可能会损坏且无法读取。我不知道有什么方法可以恢复这个问题,除非您将项目文件备份到某个地方。
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.
导航到您的项目文件夹并检查是否创建了任何 .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.
我有时会遇到这样的问题:所有运行/调试配置在丢失后都不是从 CMake 创建的。我通过从workspace.xml(来自.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).
我想这个功能不能从 IntelliJ 中删除,但我想这可以帮助:
运行/调试配置功能可能被隐藏,所以要显示它,请转到:
视图/外观/导航栏
I guess this feature can't be removed from IntelliJ but I guess this can help:
Run/Debug configuration functionality might be hidden, so to show it go to:
View/Appearance/Navigation Bar
当我切换分支时,我得到了这一点,运行配置仍然存在,如果你去编辑其中一个,它们会神奇地重新出现。
I get this when I switch branches, the Run configurations are still there, if you go and edit one of them they will magically re-appear.
Intellij Idea 中多年来非常恼人的问题。
由于用于创建运行配置的 Ant 调试器(连接?)损坏,它经常会中断。
我定期寻找解决方案,但没有成功。然后今天,在运行配置显示在面板中消失后,我确实检查了workspace.xml 的内容。所有的运行配置都在那里。
然后结果是 7 年多 bug 线索...
总是弹出非称为 Ant...
令人高兴的是,workspace.xml 的内容与所有运行配置项一起到位,您只需
并且所有运行配置都会显示并再次可用)))。
很高兴与大家分享解决方案)。
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
and all your run configs are displayed and available again))).
Happy to share with all of you the solution).
您可以尝试使用 IntelliJ IDEA 的本地历史记录功能来恢复您的运行配置。
如果您使用基于
.idea
目录的格式,那么您的配置将驻留在.idea
目录下的workspace.xml
文件中,调用 IDEA 项目视图中 .idea 目录右键菜单中的“本地历史记录”对话框,选择崩溃前某个时间的标签并恢复workspace.xml
。如果使用基于
.ipr
文件的格式,您的配置将存储在项目根目录中的.iws
文件中,您可以以类似的方式恢复该文件。如果配置是共享,它们将作为单独的 XML 文件存储在
.idea\runConfigurations
目录中或存储在.ipr
文件中(如果使用旧的项目格式)。如果本地历史记录为空,并且您使用的是 Windows,请尝试右键单击
workspace.xml
文件或< 来恢复以前的版本 ;project>.iws
位于 Windows 资源管理器 中。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 inworkspace.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 ofworkspace.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.