【发布时间】:2012-06-19 09:03:27
【问题描述】:
可能重复:
Can I run from command line program created by Eclipse?
当我尝试从命令提示符运行类文件时遇到异常,我在 eclipse 中运行相同,我没有收到任何错误
尝试从同一个文件夹运行
Exception in thread "main" java.lang.NoClassDefFoundError: testClient (wrong nam
e: com/mindcraft/queryExecutor/actionclass/testClient)
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(Unknown Source)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$000(Unknown Source)
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)
Could not find the main class: testClient. Program will exit.
【问题讨论】:
-
文件夹中是否包含名为 testClient.class 的文件?
-
确保你在类路径中有你需要的所有类和库。在 Eclipse 中,您可以在 Build Path 中找到这些信息。
-
这和 RMI 有什么关系?
标签: java