简体   繁体   English

在Eclipse Juno中运行Groovy时出现异常java.lang.IncompatibleClassChangeError

[英]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.

相关问题 从eclipse导入java.lang.IncompatibleClassChangeError SectionsPagerAdapter问题 - java.lang.IncompatibleClassChangeError SectionsPagerAdapter issue with import from eclipse mongoDB:java.lang.IncompatibleClassChangeError:实现类 - mongoDB: java.lang.IncompatibleClassChangeError: Implementing class ScalaTest - java.lang.IncompatibleClassChangeError:实现类 - ScalaTest - java.lang.IncompatibleClassChangeError: Implementing class 如何克服hadoop中的java.lang.IncompatibleClassChangeError - How to overcome java.lang.IncompatibleClassChangeError in hadoop Hibernate:我如何解决java.lang.IncompatibleClassChangeError: - Hibernate: How can i resolve java.lang.IncompatibleClassChangeError: 在Eclipse Juno上运行Java程序时的JDK - JDK while running java program on eclipse Juno Hadoop:java.lang.IncompatibleClassChangeError:找到接口org.apache.hadoop.mapreduce.JobContext,但是类是预期的 - Hadoop: java.lang.IncompatibleClassChangeError: Found interface org.apache.hadoop.mapreduce.JobContext, but class was expected 在Eclipse Juno中运行MapReduce程序时出错 - Error while running mapreduce program in eclipse juno java / lang / NoClassDefFoundError:java / lang / invoke / MethodHandle eclipse juno - java/lang/NoClassDefFoundError: java/lang/invoke/MethodHandle eclipse juno 使用Maven在Eclipse中运行Pig时出现java.lang.VerifyError - java.lang.VerifyError while running Pig in Eclipse using Maven
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM