To avoid the java.net.SocketException you have to deactivate the "Apple Wireless Direct Link" function of the OS X operating system. This can be accomplished by doing the following steps:
If, for some reason you want to reactivate AWDL you have to do the following: