tags:

views:

88

answers:

1

I get this exception in Eclipse:

java.lang.NoClassDefFoundError: org/eclipse/core/runtime/content/IContentTypeManager$IContentTypeChangeListener at java.lang.ClassLoader.defineClass1(Native Method)

I added org.eclipse.core.runtime.jar to the build path, but it doesn't seem to find IContentTypeManager there. Can someone tell me if there's another jar I need to add or some other solution for this problem?

+1  A: 

The class itself is in the org.eclipse.core.contenttype plug-in, but contenttype is re-exported by org.eclipse.core.runtime.

It is not enough to have these on the build path. To work at runtime, you must add the depedency to your manifest.mf. In fact, if you are using a plug-in project, PDE takes care of setting up the build path for you when you set the dependencies in your manifest.

So do one of the following:

  1. Require-Bundle: org.eclipse.core.runtime
  2. or add Require-Bundle: org.eclipse.core.contenttype
  3. or add Import-Package:org.eclipse.core.runtime.content
Andrew Niefer
I can't seem to find org.eclipse.core.runtime.content on my computer. and I couldn't find it online. Can you please give me more information about the dependency to manifest.mf?I have done the first two things you suggested and I still get the the exception described above.
Jenny Smith
I solved this problem by downloading the org.eclipse.core.contenttype plug-in again. I had a provios version of it, so that was the problem.Thank you for the suggestion.
Jenny Smith