Create a
java policy file and put these in it:
grant {
permission java.net.SocketPermission "host.com
ortno","connect,accept,listen,resolve";
};
where host.com is the host you are connecting and portno is the port number.
The file name should be .java.policy (starts with a dot). And don't forget the semi-column at the end of grant statement closing curly braces.