import java.net.*;
import java.io.*;
public class Jsever extends Thread{
private Socket sock;
private int id;
DataOutputStream dout;
DataInputStream din;
String ss;
char c;
public Jsever(Socket s,int i){sock=s;id=i;}
public void run()
{
try{
System.out.println("socket.."+id+"..connection success");
dout=new DataOutputStream(sock.getOutputStream());
dout.writeUTF("sock.."+id+"..welcome client");
while(true)
{
din=new DataInputStream(sock.getInputStream());
String s=din.readUTF();
System.out.println("sock.."+id+"..recvice.."+s);
}
} catch(Exception e){System.out.println("err1");}
}
public static void main(String d[])
{
int n=1;
ServerSocket sever=null;
try{
sever=new ServerSocket(6000);
System.out.println("sever start");
}
catch(IOException r){}
while(true){
try{
System.out.println("wait no."+n+"connect");
Socket s=sever.accept();
Jsever t=new Jsever(s,n++);
t.start();
}catch(IOException ee){}
}}
}
这样的一段程序我在命令提示符中运行正常!为什么在eclipse就出现java.lang.NoClassDefFoundError: Jsever
Exception in thread "main"