On my machine, the following code compiles within Eclipse but throws an exception within Netbeans. The error message says \"Exception in thread \"main\" java.net.BindExcept
If you write this in Windows OS,you can use "netstat -nao" to see which process use the 9999 port.If it is some unimportant process,you can kill this process.Otherwise you can change the port of the pragram.