我的程序编译通过,但是运行时出了下面的错误: F:\>javac xyh\AppServer.java(编译通过) F:\>java xyh\AppServer.class Exception in thread "main" java.lang.NoClassDefFoundError: xyh\AppServer/class(运行出错) 求求恩人搭救我吧! 下面是我的程序: import java.io.*; import java.awt.event.*; import java.net.*;A public class AppServer { public static void main(String args[]) { new AppServer();} } class appServer extends Thread { ServerSocket server; void fail(String message,Exception e) { System.out.println(message+"."+e);} public appServer() { try { server=new ServerSocket(2876); } catch(IOException e) { fail("不能开始服务器!",e); } System.out.println("服务器开始:"); this.start(); } public void run() { try { while(true) { Socket netClient=server.accept(); Connection con=new Connection(netClient); } } catch(IOException e) { fail("不能监听到客户!",e); } } } class Connection extends Thread { protected Socket netClient; protected BufferedReader fromClient; protected PrintStream toClient; public Connection (Socket client) { netClient=client; try { fromClient=new BufferedReader(new InputStreamReader
(netClient.getInputStream())); toClient=new PrintStream(netClient.getOutputStream()); } catch(IOException e) { try{netClient.close();} catch(IOException e1) { System.out.println("不能关闭客户套接字"+e1); return; } } this.start(); } public void run() { String Message; try { for(;;) { Message=fromClient.readLine(); if(Message==null)break; toClient.println("你已登陆成功!"); System.out.println("来自客户的信息:"+Message); } } catch(IOException e) { System.out.println("读客户流异常!"+e);} finally { try{ netClient.close();} catch(IOException e) { System.out.println("不能关闭客户套接字!"+e); return; } } } } 期盼 期盼 期盼......