线程“main” java.lang.NoClassDefFoundError 中的异常:错误的名称
2022-09-02 03:09:59
我的文件目录:
project/src/m2mcom/entities/AutomatedTelnetClient.java
/web/Simple.java
/org/apache/commons/net/telnet/TelnetClient.java
简单.java的源代码:
package m2mcom.web;
import m2mcom.entities.AutomatedTelnetClient;
import java.util.*;
import java.io.*;
public class Simple {
public static void main(String [] args) {
try {
AutomatedTelnetClient telnet = new AutomatedTelnetClient();
String answer = telnet.request();
System.out.println(answer);
} catch (Exception e) {
System.err.println("Error");
}
}
}
当我执行Simple.class,没有任何编译错误时,我得到这个错误消息:
C:\Users\Victor\Desktop\project2\src\m2mcom\web>java Simple
Exception in thread "main" java.lang.NoClassDefFoundError: Simple (wrong name: m
2mcom/web/Simple)
有谁知道如何解决这个问题?