我正在关注教程http://www.javacodegeeks.com/2012/03/twitter4j-and-esper-tracking-user.html。但是当我试图编译项目时,它给了我一些错误:
Exception in thread "main" java.lang.NoClassDefFoundError: org/antlr/runtime/RecognizerSharedState
at com.espertech.esper.epl.generated.EsperEPL2GrammarLexer.<init>(EsperEPL2GrammarLexer.java:326)
at com.espertech.esper.epl.parse.ParseHelper.parse(ParseHelper.java:99)
at com.espertech.esper.core.EPAdministratorImpl.compileEPL(EPAdministratorImpl.java:299)
at com.espertech.esper.core.EPAdministratorImpl.createEPLStmt(EPAdministratorImpl.java:142)
at com.espertech.esper.core.EPAdministratorImpl.createEPL(EPAdministratorImpl.java:94)
at com.twitter.message.TwitterTest.main(TwitterTest.java:39)
Caused by: java.lang.ClassNotFoundException: org.antlr.runtime.RecognizerSharedState
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 6 more
我添加了相关的jar esper-4.9.0.jar,antlr-3.0.1.jar,twitter4j-core-2.2.6.jar。请帮助我解决错误,因为我已经做了很多谷歌但是没有找到解决方案。
答案 0 :(得分:0)
antlr-runtime-3.2.jar是正确的jar(删除antlr)