Java Eclipse:无法打开编辑器:id org.eclipse.jdt.ui.CompilationUnitEditor 没有编辑器描述符

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18933348/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-12 12:37:38  来源:igfitidea点击:

Eclipse: Could not open the editor: No editor descriptor for id org.eclipse.jdt.ui.CompilationUnitEditor

javaeclipse

提问by Paladini

When I updated Eclipse using "Help -> Check for Updates" I got a problem.

当我使用“帮助 -> 检查更新”更新 Eclipse 时,我遇到了一个问题。

If I try to start Eclipse, Eclipse opens but show a error message like this:

如果我尝试启动 Eclipse,Eclipse 会打开但显示如下错误消息:

  Could not open the editor: No editor descriptor 
  for id org.eclipse.jdt.ui.CompilationUnitEditor

And inside "Details" of the error, I have the following description:

在错误的“详细信息”中,我有以下描述:

    org.eclipse.ui.PartInitException: No editor descriptor for id org.eclipse.jdt.ui.CompilationUnitEditor
    at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:601)
    at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:465)
    at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)
    at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:313)
    at org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:180)
    at org.eclipse.ui.internal.presentations.util.PresentablePartFolder.select(PresentablePartFolder.java:270)
    at org.eclipse.ui.internal.presentations.util.LeftToRightTabOrder.select(LeftToRightTabOrder.java:65)
    at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation.selectPart(TabbedStackPresentation.java:473)
    at org.eclipse.ui.internal.PartStack.refreshPresentationSelection(PartStack.java:1245)
    at org.eclipse.ui.internal.PartStack.handleDeferredEvents(PartStack.java:1213)
    at org.eclipse.ui.internal.LayoutPart.deferUpdates(LayoutPart.java:400)
    at org.eclipse.ui.internal.PartSashContainer.handleDeferredEvents(PartSashContainer.java:1409)
    at org.eclipse.ui.internal.LayoutPart.deferUpdates(LayoutPart.java:400)
    at org.eclipse.ui.internal.WorkbenchPage.handleDeferredEvents(WorkbenchPage.java:1495)
    at org.eclipse.ui.internal.WorkbenchPage.deferUpdates(WorkbenchPage.java:1485)
    at org.eclipse.ui.internal.WorkbenchPage.closeEditors(WorkbenchPage.java:1459)
    at org.eclipse.ui.internal.WorkbenchPage.closeEditor(WorkbenchPage.java:1514)
    at org.eclipse.ui.internal.EditorPane.doHide(EditorPane.java:61)
    at org.eclipse.ui.internal.PartStack.close(PartStack.java:537)
    at org.eclipse.ui.internal.EditorStack.close(EditorStack.java:206)
    at org.eclipse.ui.internal.PartStack.close(PartStack.java:120)
    at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation.handleEvent(TabbedStackPresentation.java:83)
    at org.eclipse.ui.internal.presentations.util.AbstractTabFolder.fireEvent(AbstractTabFolder.java:269)
    at org.eclipse.ui.internal.presentations.util.AbstractTabFolder.fireEvent(AbstractTabFolder.java:278)
    at org.eclipse.ui.internal.presentations.defaultpresentation.DefaultTabFolder.access(DefaultTabFolder.java:1)
    at org.eclipse.ui.internal.presentations.defaultpresentation.DefaultTabFolder.closeButtonPressed(DefaultTabFolder.java:71)
    at org.eclipse.ui.internal.presentations.PaneFolder.notifyCloseListeners(PaneFolder.java:631)
    at org.eclipse.ui.internal.presentations.PaneFolder.close(PaneFolder.java:206)
    at org.eclipse.swt.custom.CTabFolder.onMouse(CTabFolder.java:1598)
    at org.eclipse.swt.custom.CTabFolder.handleEvent(CTabFolder.java:261)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1258)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3588)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3209)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
    at org.eclipse.ui.internal.Workbench.access(Workbench.java:2494)
    at org.eclipse.ui.internal.Workbench.run(Workbench.java:674)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1386)

What can I do to solve this problem? I don't do anything, I just update Eclipse from their own "Check for Updates".

我能做些什么来解决这个问题?我什么都不做,我只是从他们自己的“检查更新”中更新 Eclipse。

采纳答案by Paladini

As you can see here, a workaround for your problem is just move the "~/.eclipse" to another folder.

正如您在此处看到的,解决您的问题的方法是将“~/.eclipse”移动到另一个文件夹。

So:

所以:

  1. Close Eclipse
  2. Open "Terminal"
  3. Type the following command:
  1. 关闭日食
  2. 打开“终端”
  3. 输入以下命令:

e.g.:

例如:

mv ~/.eclipse somewhereYouWant

When I got this problem, I just:

当我遇到这个问题时,我只是:

mv ~/.eclipse home/paladini/Downloads

回答by Aman

In Windows.

在 Windows 中。

  1. Open Eclipse folder
  2. Copy all the files and folder in it
  3. Paste it to other location
  4. Start the Eclipse from the new location
  5. Change the workspace location
  6. start.
  1. 打开 Eclipse 文件夹
  2. 复制其中的所有文件和文件夹
  3. 粘贴到其他位置
  4. 从新位置启动 Eclipse
  5. 更改工作区位置
  6. 开始。

回答by aCiD

Had a similar error when I removed Eclipse Typescript plugin

当我删除Eclipse Typescript 插件时出现了类似的错误

Tried to open typescript(*.ts) files and got this error:

尝试打开 typescript(*.ts) 文件并收到此错误:

No editor descriptor for id com.palantir.typescript.text.typeScriptEditor

And I was not allowed to move the workspace.

而且我不被允许移动工作区。

On Eclipse Oxygen, Window -> Perspective -> Close All worked for me.

在 Eclipse Oxygen 上,Window -> Perspective -> Close All 对我有用。

回答by Elliptical view

The other solutions here didn't work for me.

这里的其他解决方案对我不起作用。

Perhaps my problem was as the result of trying to get eclipse setup the first time and re-installed different versions of it: a c++ version and then a plain base version + separately installed add-ons. (Since I also want to use it for other languages I was confused how to set it up.)

也许我的问题是第一次尝试安装 eclipse 并重新安装它的不同版本的结果:一个 c++ 版本,然后是一个普通的基础版本 + 单独安装的附加组件。(因为我也想将它用于其他语言,所以我很困惑如何设置它。)

Solution:I closed eclipse, then renamed: ~/eclipse, ~/workbenchand ~/.eclipse; (in other words, remove them), and finally reinstalled, and restarted.

解决方案:我关闭了eclipse,然后重命名了:~/eclipse, ~/workbenchand ~/.eclipse; (换句话说,删除它们),最后重新安装,并重新启动。

cd ~
mv .eclipse           .eclipse~            #renames
mv  eclipse            eclipse~ 
mv  eclipse-workspace  eclipse-workspace~

~/nobak/Installers/eclipse/eclipse-installer/eclipse-inst    #reinstall

eclipse/cpp-2018-09/eclipse/eclipse   #restart


My box:

我的盒子:

OS: GNU/Linux Debian 9.5 (x86-64); 
Cinnamon desktop: 3.2.7; 
Linux Kernel: 4.9.0-8-amd64; 
Processor: Intel Core 2 Duo P8800; 
Graphics Card: AMD/ATI RV710/M92 Mobility Radeon HD 4530/4570/545v

回答by mkebri

To resolve this issue, reset the editor to the default configuration: in eclipse (or STS....) menu bar got to :

要解决此问题,请将编辑器重置为默认配置:在 eclipse(或 STS....)菜单栏中:

Windows > Preferences > Editors >: Restore Defaults ; Apply and Close

Cordially,

亲切地,