Code source :
import java.lang.*;
import java.io.*;
import java.net.*;
public class Serveur {
InetAddress addr;
ServerSocket srv;
Socket sock;
public Serveur ()throws IOException {
Socket sock = new Socket (addr,7777);
srv = new ServerSocket (7777) ;
}
public void main (String args[]){
try {
Serveur test = new Serveur();
sock = srv.accept ( ) ;
}
catch (IOException e) {
System.out.println(e);
return;
}
}
}
pas de probleme lors de la compilation mais lors de l'execution le pb suivant apparait :
java.lang.NoSuchMethodError: main
Exception in thread "main"
Je sais pas comment resoudre le pb.