I doubt it's anything to do with classpath or the jdk, but could well have to do with the configuratoin of some other part of your machine - e.g. its networking setup. Don't know much about that, myself.
Let's be sure which line is throwing the exception. It's probably the new Socket(), but it could conceiveably be the new ClientGetMessages(), since I have no idea what other code is in there. Put in a e.printStacktrace() to be sure exactly which line is throwing the exception. Then, if it's the new Socket() as I suspect, you really don't care about the rest of the program for now. Try a simple
test program:
<code><pre>import java.net.*;
public class Test {
public static void main(
String[] s) {
try {
Socket socket = new Socket("127.0.0.1", 9090);
System.out.println("Success!");
}
catch (Exception e) {
e.printStackTrace();
}
}
}</pre></code>
Assuming this doesn't connect either, you can focus on this code by itself. Play around with the numbers, or go to the Sockets and Internet Protocols forum here at JavaRanch and ask there (since we don't appear to be attracting the attention of anyone knowledgeable about sockets here so far.)