[英]Exception java.lang.IncompatibleClassChangeError while running Groovy in Eclipse Juno
I have recently downloaded Eclipse Juno and installed latest Groovy plugin. 我最近下载了Eclipse Juno并安装了最新的Groovy插件。
Now here is how my Groovy file looks like. 现在这是我的Groovy文件的样子。
package groovy_support
class TimePass {
static void main(def args){
println "Hello World"
}
}
When i run this from either my previous eclipse version (indigo) or from command line, it runs. 当我从我之前的eclipse版本(indigo)或命令行运行它时,它会运行。 On Eclipse Juno, however, it complains with following exception on Eclipse console.
然而,在Eclipse Juno上,它抱怨Eclipse控制台上出现以下异常。
Caught: java.lang.IncompatibleClassChangeError: Found class org.objectweb.asm.ClassVisitor, but interface was expected
java.lang.IncompatibleClassChangeError: Found class org.objectweb.asm.ClassVisitor, but interface was expected
Note that "Groovy Libraries" are already on classpath. 请注意,“Groovy库”已经在类路径中。
Now what am i doing wrong here? 那我在这里做错了什么?
Are you on the latest groovy/dependent jars? 你是最新的groovy /依赖罐子吗? .
。
The java.lang.IncompatibleClassChangeError
happens due to back ward compatibility issues. 由于后台兼容性问题,发生了
java.lang.IncompatibleClassChangeError
。 The client code needs to be recompiled to resolve it. 需要重新编译客户端代码才能解决它。
The specific error you are seeing is because org.objectweb.asm.ClassVisitor
is an Interface in asm 3.2 and a Class in asm 4.0 onwards. 您看到的具体错误是因为
org.objectweb.asm.ClassVisitor
是asm 3.2中的接口和asm 4.0以后的类 。
I had the same problem using Spring and Groovy in one module. 我在一个模块中使用Spring和Groovy时遇到了同样的问题。 Spring in 3.1.2 still uses older ASM, Groovy uses the one with the class.
3.1.2中的Spring仍然使用较旧的ASM,Groovy使用类中的一个。 While it may be possible to adjust some excludes, I bet it's not always an option.
虽然可以调整一些排除,但我敢打赌它并不总是一种选择。
After reading this thread I decided to do with groovy-all.jar instead of the list of all the Groovy needed libs. 在阅读了这个帖子之后,我决定用groovy-all.jar而不是所有Groovy所需库的列表。 If that is an option for you, it might be easy way how to avoid any further problems.
如果这是您的选择,那么如何避免任何进一步的问题可能是一种简单的方法。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.