5

groovy-all-2.1.5.jar과 함께 제공되는 Eclipse-Groovy 플러그인의 최신 버전 (2.8.0)을 사용하고 있습니다. 나는 내 그루비 프로젝트에 Guice을 추가, 내가 이클립스 내부에서 실행할 갈 때 콘솔 출력에 다음과 같은 오류가 발생합니다 : ShortTypeHandling는 2.3.x.까지 추가되지 않았기 때문에 그것의Eclipse-Groovy 플러그인 Groovy 라이브러리를 변경하는 방법은 무엇입니까?

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 

따르면 this answer에 이제는 내 Eclipse 프로젝트의 클래스 경로에 groovy-all-2.3.3.jar을 첨부하고 싶습니다.

문제는 도서관에서 Groovy Libraries 라이브러리가 사용하는 라이브러리를 변경하는 데 편집 권한이없는 것 같습니다. 그리고 2.3.3 JAR을 빌드 경로에 수동으로 추가하면 다음 오류가 발생합니다.

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 

어떤 옵션이 있습니까?

답변

6

Groovy-eclipse 버전에는 자체 컴파일러 and are "locked" to them이 있습니다. 창> 환경 설정> Groovy> 컴파일러에 나열된 버전으로 버전을 변경할 수 있지만 AFAIK에서는 플러그인 디렉토리의 용기에있는 groovy-all 항아리를 변경하여 임의의 버전의 컴파일러로 변경할 수 없습니다.

groovy-eclipse compiler version change

당신은 마켓 플레이스 update site을 사용하여 새 컴파일러 버전을 설치하거나 능가 할 수


업데이트 :, 새로운 소프트웨어 설치> 도움말을 통해 추가 컴파일러 버전을 설치 그루비 업데이트 사이트를 선택하고 확장 Extra Groovy Compilers 세션 :

enter image description here

참고 i는 like to live dangerously이므로 스냅 샷 업데이트 사이트를 사용하고 있습니다.

+3

고맙습니다 @ 윌 P (+1) - 당신이 여기 해결책을 찾았을지 모르지만, 제 일식에서는 "* 2.3.3.xx로 전환 ..."버튼/옵션이 없습니다. . 나는 1.8.7 및 2.0.7 버튼 만 가지고 있는데, 이는 2.3.x까지 'ShortTypeHandling'이 도입되지 않았기 때문에 나를 도와주지 않습니다. ** * Groovy 컴파일러 설정 * 옵션에 버전을 추가하는 방법을 알고 있습니까? ** 다시 한번 감사드립니다! – smeeb

+0

@smeb 나는 같은 문제가 있습니다. 2.4 기능을 설치했지만 기본 설정에서 전환 할 버튼이 없습니다. 이 문제를 해결해 봤어? 감사. – Chris

+0

사실, 저에게 맞는 대답을 찾았습니다 : eclipse.ini 파일에 -clean을 추가하십시오. @Lari Hotari (https://stackoverflow.com/questions/21413003/groovy-compiler-mismatch-after-installation 참조)에 감사드립니다. – Chris