My new laptop (Alienware m17x) throws a java.net.SocketException: Invalid argument: connect when I run the following basic code:
Server.java:
Also check if your IDE is using the JRE which you expect.
I had same issue:
java.sql.SQLException: JZ006: Caught IOException: java.net.SocketException: Invalid argument: create
When I checked my run configuration, my default JRE was pointing to 'Project Execution Environment 'JavaSE1.7' which was not I was expecting.
I changed it to option Alternate JRE and set the JAVA 8 as installed jre. which has solved my problem.