如何在Eclipse中修复不再打开的工作空间由于EGit?

问题描述

我的Eclipse工作区不再打开。 Eclipse开始启动,什么都没有。 这是我的日志:

!ENTRY org.eclipse.egit.ui 2 0 2020-10-26 22:14:42.055
!MESSAGE Warning: The environment variable HOME is not set. The following directory will be used to store the Git
user global configuration and to define the default location to store repositories: 'C:\Users\xav_m'. If this is
not correct please set the HOME environment variable and restart Eclipse. Otherwise Git for Windows and
EGit might behave differently since they see different configuration options.
This warning can be switched off on the Team > Git > Confirmations and Warnings preference page.
!ENTRY org.eclipse.ui.workbench 4 0 2020-10-26 18:34:52.194
!MESSAGE FrameworkEvent ERROR
!STACK 0
java.lang.NullPointerException
    at org.eclipse.ui.internal.AbstractWorkingSetManager.getUniqueDescriptors(AbstractWorkingSetManager.java:685)
    at org.eclipse.ui.internal.AbstractWorkingSetManager.bundleChanged(AbstractWorkingSetManager.java:632)
    at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:973)
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
    at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345)

几周前,我安装了GitBash,但从未使用过它,只是配置了我在GitHub帐户上使用的用户名和电子邮件地址。我还没有创建本地存储库。 我几周前安装了Egit插件,没有使用它,而今天更新了它。自从此更新以来,当我尝试启动Eclispe时,上面显示了消息。

我试图更改变量Home的值为“%USERPROFILE%”,只是为了看看,但是我收到以下消息:

!ENTRY org.eclipse.ui.workbench 4 0 2020-10-26 18:29:50.338
!MESSAGE FrameworkEvent ERROR
!STACK 0
java.lang.NullPointerException
    at org.eclipse.ui.internal.AbstractWorkingSetManager.getUniqueDescriptors(AbstractWorkingSetManager.java:685)
    at org.eclipse.ui.internal.AbstractWorkingSetManager.bundleChanged(AbstractWorkingSetManager.java:632)
    at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:973)
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:234)
    at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:345)

表示相同的消息,没有有关git的消息。 我创建了一个本地存储库“ git”,并在我的文件用户中对其进行了初始化,但是它没有用。 我应该卸载GitBash吗?或删除我的担心世界中的.Metadata? 谢谢您的帮助

解决方法

不要尝试恢复工作空间。创建一个新的工作区。如果所有项目都存储在远程git存储库中,则只需从本地存储库中重新导入项目即可(尽管不清楚是否克隆了存储库)。如果没有将任何项目存储在git中,而是存储在本地磁盘上的本地目录中,则只需从这些位置重新导入(即使该位置在原始工作空间内)。

,

好吧,经过一些研究,我尝试了以下方法,并且对我有用: 转到.metadata / .plugins / org.eclipse.e4.workbench / workbench.xmi并删除workbench.xmi

Eclipse现在可以工作了,但是我当然不为什么。 如果有人有一点线索,我就接受了:)