4

I get these exceptions when opening Groovy files:

org.osgi.framework.BundleException: Exception in org.codehaus.groovy.eclipse.refactoring.Activator.start() of bundle org.codehaus.groovy.eclipse.refactoring.
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:734)
    at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683)
    at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381)
...
Caused by: java.lang.NoClassDefFoundError: org/codehaus/jdt/groovy/integration/LanguageSupport

or

java.lang.NoClassDefFoundError: org/codehaus/groovy/eclipse/refactoring/formatter/GroovyIndentationService
    at org.codehaus.groovy.eclipse.editor.GroovyAutoIndentStrategy.<init>(GroovyAutoIndentStrategy.java:50)
    at org.codehaus.groovy.eclipse.editor.GroovyConfiguration.getAutoEditStrategies(GroovyConfiguration.java:181)
...
Caused by: org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter$TerminatingClassNotFoundException: An error occurred while automatically activating bundle org.codehaus.groovy.eclipse.refactoring (47).
...
Caused by: org.osgi.framework.BundleException: Exception in org.codehaus.groovy.eclipse.refactoring.Activator.start() of bundle org.codehaus.groovy.eclipse.refactoring.
...
Caused by: java.lang.NoClassDefFoundError: org/codehaus/jdt/groovy/integration/LanguageSupport
Caused by: java.lang.ClassNotFoundException: org.codehaus.jdt.groovy.integration.LanguageSupport
tim_yates
  • 167,322
  • 27
  • 342
  • 338
Aaron Digulla
  • 321,842
  • 108
  • 597
  • 820

1 Answers1

5

Groovy needs a special version of the org.eclipse.jdt.core plugin.

For 3.7, the original plugin has the version 3.7.3.v2012... but you need 3.7.3.xx-2013*

If you start Eclipse via an "Eclipse Application" launch config, open it in the "Run Configurations" dialog. In the "Plug-ins" tab, search for "jdt.core" and activate the correct plugin.

If it's not there, remove and install the Groovy feature again.

Aaron Digulla
  • 321,842
  • 108
  • 597
  • 820
  • This is still up-to-date, even 9 years later. After upgrading from Eclipse 2022-03 to 2022-06 I got the described error message. Updating the "Groovy Development Tools" Plugin from version 4.5.0.RELEASE to 4.6.0.RELEASE via Eclipse Marketplace removed that error message. :-) – S. Doe Jul 06 '22 at 04:34
  • 1
    @S.Doe I still get that error on 2022-06 even with Groovy Development Tools at 4.6.0.RELEASE. I am explicitly removing that package and re-adding it in the hopes that it works. Turns out... it didn't. I cannot use the Groovy Editor at all. :/ – John Czukkermann Jul 15 '22 at 20:43