37

My Eclipse cannot show the editor window.

Error:

Could not open the editor: The editor class could not be instantiated. This usually indicates a missing no-arg constructor or that the editor's class name was mistyped in plugin.xml.

Notes:

  • I'm using different Eclipse (and not plug-ins) for C++ and Python - and they work flawlessly, it's just the java eclipse that is causing troubles.
  • I've already tried re-installing eclipse, and even reinstalling java. any idea?
  • It has no troubles displaying the project file, it's "just" the *.java and *.class files that cannot be opened.

Stack trace

org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter$TerminatingClassNotFoundException: An error occurred while automatically activating bundle org.eclipse.jdt.ui (150).
    at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:121)
    at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:453)
    at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
    at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:393)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:469)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410)
    at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at org.eclipse.osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:338)
    at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:232)
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1197)
    at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:174)
    at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:904)
    at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
    at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
    at org.eclipse.ui.internal.WorkbenchPlugin$1.run(WorkbenchPlugin.java:267)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.ui.internal.WorkbenchPlugin.createExtension(WorkbenchPlugin.java:263)
    at org.eclipse.ui.internal.registry.EditorDescriptor.createEditor(EditorDescriptor.java:235)
    at org.eclipse.ui.internal.EditorManager.createPart(EditorManager.java:845)
    at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:609)
    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.EditorAreaHelper.setVisibleEditor(EditorAreaHelper.java:271)
    at org.eclipse.ui.internal.EditorManager.setVisibleEditor(EditorManager.java:1429)
    at org.eclipse.ui.internal.EditorManager$5.runWithException(EditorManager.java:942)
    at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:31)
    at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
    at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4041)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3660)
    at org.eclipse.ui.application.WorkbenchAdvisor.openWindows(WorkbenchAdvisor.java:803)
    at org.eclipse.ui.internal.Workbench$31.runWithException(Workbench.java:1567)
    at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:31)
    at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
    at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4041)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3660)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2548)
    at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
    at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
    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:369)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:620)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1408)
Caused by: org.osgi.framework.BundleException: The activator org.eclipse.jdt.internal.ui.JavaPlugin for bundle org.eclipse.jdt.ui is invalid
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.java:156)
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:751)
    at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:370)
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:284)
    at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:417)
    at org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:265)
    at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:106)
    ... 57 more
Caused by: java.lang.NoClassDefFoundError: org/eclipse/jdt/core/IBufferFactory
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
    at java.lang.Class.getConstructor0(Unknown Source)
    at java.lang.Class.newInstance0(Unknown Source)
    at java.lang.Class.newInstance(Unknown Source)
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.java:151)
    ... 63 more
Caused by: org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter$TerminatingClassNotFoundException: An error occurred while automatically activating bundle org.eclipse.jdt.core (140).
    at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:121)
    at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:453)
    at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216)
    at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:393)
    at org.eclipse.osgi.internal.loader.SingleSourcePackage.loadClass(SingleSourcePackage.java:33)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:466)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:410)
    at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 69 more
Caused by: org.osgi.framework.BundleException: Exception in org.eclipse.jdt.core.JavaCore.start() of bundle org.eclipse.jdt.core.
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:806)
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:755)
    at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:370)
    at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:284)
    at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:417)
    at org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:265)
    at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:106)
    ... 78 more
Caused by: java.lang.NullPointerException
    at org.eclipse.core.runtime.Path.<init>(Path.java:183)
    at org.eclipse.core.internal.resources.WorkspaceRoot.getProject(WorkspaceRoot.java:181)
    at org.eclipse.jdt.internal.core.ExternalFoldersManager.isExternalFolderPath(ExternalFoldersManager.java:90)
    at org.eclipse.jdt.internal.core.JavaProject.addToResult(JavaProject.java:2738)
    at org.eclipse.jdt.internal.core.JavaProject.resolveClasspath(JavaProject.java:2688)
    at org.eclipse.jdt.internal.core.JavaProject.resolveClasspath(JavaProject.java:2783)
    at org.eclipse.jdt.internal.core.DeltaProcessingState.getRootInfos(DeltaProcessingState.java:301)
    at org.eclipse.jdt.internal.core.DeltaProcessingState.initializeRootsWithPreviousSession(DeltaProcessingState.java:271)
    at org.eclipse.jdt.internal.core.JavaModelManager.startup(JavaModelManager.java:4712)
    at org.eclipse.jdt.core.JavaCore.start(JavaCore.java:5048)
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:783)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:774)
    ... 84 more

EDIT:

eclipse version: 3.6.2
eclipse.ini file:

-startup
plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.2.R36x_v20101222
-product
org.eclipse.epp.package.java.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx384m

EDIT 2:
I changed the workspace and it fixed the problem (for the new workspace at least) but still - no idea why it happened. (though I am still curious, so I leave this question open).

Tanmay Patil
  • 6,882
  • 2
  • 25
  • 45
amit
  • 175,853
  • 27
  • 231
  • 333
  • 1
    Search for this bug in https://bugs.eclipse.org/bugs/ and report it if does not exist yet. – Gedrox Jun 22 '11 at 07:45
  • Modify the Eclipse source file using Eclipse, it'll work... Oh darn, it's a recursive problem ;-) Sorry though, I don't know the answer, it was just too tempting. – SteeveDroz Jun 22 '11 at 07:46
  • Which eclipse version are you using ? Also can you please post your eclipse.ini file ? – Simeon Jun 22 '11 at 07:46

14 Answers14

35

This is often a problem with temporary files saved by eclipse plugins. Check YOUR_WORKSPACE/.metadata/.plugins/org.eclipse.jdt.core/. There are a lot of index files. Sometimes it helps to delete them. Also, start your eclipse with -clean.

But I think your problem is slightly different. Did you have a reference to a library(jar-file) somewhere in your filesystem? If you deleted it or moved it, eclipse can't build your projects.

Did you refresh all your projects?

Anton Menshov
  • 2,266
  • 14
  • 34
  • 55
FlorianOver
  • 997
  • 1
  • 7
  • 11
  • For me the first option (deleting stuff from plugins) helped. Thank you! – Elven Sep 10 '12 at 22:35
  • Thank you, thank you, thank you! This is the *only* helpful advice on the entire internet - everything else is variations on the completely impractical nuclear option "rebuild your entire workspace". – Kilian Foth Jul 01 '13 at 06:57
  • Starting with -clean should be made a default. – hiergiltdiestfu Oct 21 '14 at 07:10
  • Starting Eclipse with `- clean` fixed the problem for me. It was Luna version. – PM 77-1 Apr 20 '16 at 19:26
  • I had to create new workspace and download from repository all bundles of my RCP application to fix this issue. It was only a problem for RCP App, eclipse was fine. Everything else didn't help. – A Kunin Aug 20 '20 at 20:25
  • for me I edited the eclipse.exe icon on desktop and in Target I added `"C:/path/to/eclipse/exe/eclipse.exe"-clean ` and its work fine for me. It is for eclipse-neon4 – SUDARSHAN BHALERAO Aug 03 '21 at 13:56
12

I've got the same problem though my eclipse is much newer - 4.2 (Juno). For me the solution was to remove <workspace>/.metadata/.plugins/org.eclipse.core.resources/.snap. Afterwards I found this bug in eclipse.org: Bug 178988 - Crash at startup due to ".snap" files.

Hope this will help somebody.

Gerold Broser
  • 14,080
  • 5
  • 48
  • 107
bersen
  • 370
  • 4
  • 8
3
at org.eclipse.core.runtime.Path.<init>(Path.java:183)
at org.eclipse.core.internal.resources.WorkspaceRoot.getProject(WorkspaceRoot.java:181)
at org.eclipse.jdt.internal.core.ExternalFoldersManager.isExternalFolderPath(ExternalFoldersManager.java:90)
at org.eclipse.jdt.internal.core.JavaProject.addToResult(JavaProject.java:2738)
at org.eclipse.jdt.internal.core.JavaProject.resolveClasspath(JavaProject.java:2688)

The stack trace seem to indicate that there is a problem with your classpath.

  1. Maybe your JRE is pointing to an invalid location / isn't defined? (Window->Preferences->Java->Installed JREs).
  2. Maybe your project contains invalid class path entries? Try to create a new java project and check if that is working as expected. If it works check the classpath of your not working project.

Edit: Another Idea ... launch eclipse on an other workspace. Then create a launch configuration for an "Eclipse Configuration" with the workspace that produces an error. Set a java exception breakpoint for NullPointerException. Start in debug mode and you can inspect the variables to see which path produces the problems.

Arne Deutsch
  • 14,629
  • 5
  • 53
  • 72
  • I will check option1 in a minute, though I doubt it (see edit2). for option2: it happened for all projects in this workspace. (changing the workspace solved the problem, but I have no idea why). – amit Jun 22 '11 at 07:59
3

Google this error and you get plenty of hits in a variety of (Eclipse) IDE's and plugins. There seems to be no record of real 'fix' though, besides the one you found out where you create a new workspace.

3.6.2.r362_v20110210 is the version I'm running. Are you sure you're on 3.6.2? You're first edit lists

-startup plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar --launcher.library plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.2.R36x_v20101222

which seems to point at an older release.

I agree with another poster that you should definitely search and/or post this on Eclipse's bugtracking system. That's the least you can do when you use open source software.

Wivani
  • 2,036
  • 22
  • 28
  • the 3.6.2 detail was taken from the readme file, so I guess assume it's valid. – amit Jun 22 '11 at 08:27
  • My mistake. Apparently that's how it's in my eclipse.ini as well. – Wivani Jun 22 '11 at 08:37
  • [This](https://bugs.eclipse.org/bugs/show_bug.cgi?id=184127#c7) is one of the bug reports in Eclipse covering the same error and seems to point at some cache corruption. Also the fact that you have several Eclipse instances is mentioned here. I find it very strange that a fix that was supposedly added in the 3.4 and 3.5 version lines is reoccuring now in 3.6 but that's not entirely impossible of course. – Wivani Jun 22 '11 at 08:51
1

I tried a couple of options

  1. delete cache files within .plugins
  2. delete all index files in <workspace>/.metadata/.plugins/org.eclipse.jdt.core
  3. delete snap file in <workspace>/.metadata/.plugins/org.eclipse.core.resources/.snap
  4. -clean as a start up parameter
  5. -initialize as a start up parameter

But I keep getting the error back randomly.

So far, the only option that worked consistently is removing the .snap file, the first time we launch eclipse after removing .snap file it works fine.

Also any time we launch it in a new workspace; it works fine. but we would hate to switch the workspace for this reason.

Moreover if we close and relaunch eclipse the issue comes back randomly.

Tejus Prasad
  • 6,322
  • 7
  • 47
  • 75
ravikanth
  • 151
  • 1
  • 10
  • I got this problem at Jasper Studio 6.3.1 . And deleting .snap file is the solution for me. Then, unfortunately, my project at Project Explorer is gone, but it is not a big problem. Thank you bro! – ÖMER TAŞCI Aug 15 '17 at 11:37
0

I was getting this for FlashBuilder 4.7. It was a permissions issue. On Mac OSX, from the info box, I gave my user READ & WRITE access to Flash Builder 4.7 folder, then did "Apply to enclosed items..." and that fixed it.

Gabriel Jensen
  • 4,082
  • 1
  • 17
  • 14
0

The solution to the above problem is to go to workspace.metadata.plugins\org.eclipse.jdt.core & remove all the index files.

Thanks FlorianOver

Gaurav
  • 21
  • 1
  • 3
0

Had the same problem(on Indigo 3.7) and getting right version of jadclipse jar(net.sf.jadclipse_3.3.0.jar with Jad 1.5.8g) did it for me

iddqd
  • 1,329
  • 1
  • 8
  • 9
0

Removing the index files as suggested by others didn't help in my case. I had to reset the perspective: right-click the "Java" perspective toggle button in the upper right corner, choose "Reset". At least it's better than recreating the entire workspace.

junkdog
  • 855
  • 7
  • 8
0

For me it worked to delete workspace/.metadate/.lock and then restart by using eclispe -clean -refresh

Eleria
  • 1
0

Here was simple. Right-click in the class and choose the / open with / Java Editor, or Generic Text Editor option.

Aqui foi simples. Clique na classe com o botão direito e escolha a opção / open com / Editor Java, ou Editor de Texto Genérico.

0

When I faced this issue. I simple updated the eclipse and it resolve the problem.

Manish Agrawal
  • 794
  • 1
  • 9
  • 23
0

A solution which worked for me (after first unsuccessfully trying the other more accurate steps listed above) was to do as below:

  1. Close Eclipse and delete all the contents of {Workspace}.metadata.plugins folder.
  2. Open Eclipse. It does not show any projects.
  3. Import the projects into the workspace by going to the File menu, clicking import and continuing with steps.

The issue gets resolved this way. However, a drawback is that you have to import the projects again after the steps.

Saurabh Rana
  • 168
  • 3
  • 22
-1

I faced the same issue. It was basically caused by a version mismatch of the jadclipse jar. Initially I had jadclipse_3.2.1.jar but then I updated to net.sf.jadclipse_3.3.0.jar. Resolved the issue.

m02ph3u5
  • 3,022
  • 7
  • 38
  • 51
  • Welcome to StackOverflow, this is not a good quality answer, once you have enough reputation, you can leave comments. – Towkir Apr 24 '19 at 09:05
  • This actually is a reasonable answer. Would be better if you added *how* to do this, though. – m02ph3u5 Apr 24 '19 at 09:11