我正在尝试在Eclipse中运行使用java RMI的项目,但是当我运行它时,它会给我以下错误:
java.rmi.ServerError: Error occurred in server thread; nested exception is:
java.lang.NoClassDefFoundError: org/objectweb/asm/ClassVisitor
asm-3.1.jar库已经在项目类路径中,如果我尝试导入该类 org.objectweb.asm.ClassVisitor,它是正确看到的。因此,问题出现在运行时。
有什么建议吗?
谢谢
编辑(Eclipse类路径文件):
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
<classpathentry kind="lib" path="lib/asm-3.1.jar"/>
<classpathentry kind="lib" path="lib/asm-analysis-3.1.jar"/>
<classpathentry kind="lib" path="lib/asm-commons-3.1.jar"/>
<classpathentry kind="lib" path="lib/asm-tree-3.1.jar"/>
<classpathentry kind="lib" path="lib/asm-util-3.1.jar"/>
<classpathentry kind="lib" path="lib/asm-xml-3.1.jar"/>
<classpathentry kind="lib" path="lib/commons-io-2.4.jar"/>
<classpathentry kind="lib" path="lib/java-cup-11a.jar"/>
<classpathentry kind="lib" path="lib/jdom.jar"/>
<classpathentry kind="lib" path="lib/jmockit_B.jar"/>
<classpathentry kind="lib" path="lib/jode-1.1.2-pre1.jar"/>
<classpathentry kind="lib" path="lib/junit-4.6.jar"/>
<classpathentry kind="lib" path="lib/junit-4.9b2.jar"/>
<classpathentry kind="lib" path="lib/ModifiedClasses.jar"/>
<classpathentry kind="lib" path="lib/tools.jar"/>
<classpathentry kind="lib" path="lib/uispec4j-2.4-jdk16.jar"/>
<classpathentry kind="lib" path="lib/uispec4j-jdk6-2.0.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
答案 0 :(得分:0)
将运行时所需的jar添加到Eclipse的Run类路径配置中。单击&#34;添加JAR&#34;或者&#34;添加外部JAR&#34;按钮: