How to change the Eclipse-Groovy Groovy plugin libraries?

I am using the latest version (2.8.0) of the Eclipse-Groovy plugin that comes with groovy-all-2.1.5.jar . I added Guice to my Groovy project, and when I go to start them from Eclipse, I get the following error in the console output:

 Caught: java.lang.NoClassDefFoundError: org/codehaus/groovy/runtime/typehandling/ShortTypeHandling java.lang.NoClassDefFoundError: org/codehaus/groovy/runtime/typehandling/ShortTypeHandling at net.me.myapp.utils.restclient.RestClient.<init>(RestClient.groovy:57) at net.me.myapp.inject.UserServiceClientModule.configure(UserServiceClientModule.groovy:34) at com.google.inject.AbstractModule.configure(AbstractModule.java:59) at com.google.inject.spi.Elements$RecordingBinder.install(Elements.java:223) at com.google.inject.spi.Elements.getElements(Elements.java:101) at com.google.inject.internal.InjectorShell$Builder.build(InjectorShell.java:133) at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:103) at com.google.inject.Guice.createInjector(Guice.java:95) at com.google.inject.Guice.createInjector(Guice.java:72) at com.google.inject.Guice.createInjector(Guice.java:62) at net.me.myapp.UserServiceClient.<init>(UserServiceClient.groovy:37) at net.me.myapp.UserServiceClient.main(UserServiceClient.groovy:45) Caused by: java.lang.ClassNotFoundException: org.codehaus.groovy.runtime.typehandling.ShortTypeHandling ... 12 more 

According to this answer , because ShortTypeHandling not added until 2.3.x. So now I would like to attach groovy-all-2.3.3.jar to my Eclipse project class path.

The problem is that I do not have edit permissions to change the Groovy Libraries library used under the hood. And when I manually add JDP 2.3.3 to my build path, I get the following error:

 Caught: java.lang.ExceptionInInitializerError java.lang.ExceptionInInitializerError Caused by: groovy.lang.GroovyRuntimeException: Conflicting module versions. Module [groovy-all is loaded in version 2.1.5 and you are trying to load version 2.3.3 

What are my options?

+5
source share
1 answer

Groovy -eclipse versions have their own compilers and are "locked" for them . You can change the versions to everything that is specified in the section "Window"> "Preferences"> Groovy> "Compilers", but, AFAIK, you cannot switch to an arbitrary version of the compiler by simply changing the groovy-all banner in the guts of the plug-in dir.

groovy-eclipse compiler version change

You can install new versions of the compiler using the update site or in the eclipse market


Update: Install additional versions of the compiler using the Help> Install new software, select the Groovy update site, and expand the Extra Groovy Compilers session:

enter image description here

Note. I use the snapshot update site because I like to live dangerously .

+6
source

Source: https://habr.com/ru/post/1203428/


All Articles