JavaMail API to iMail — java.net.SocketException: Permission denied: connect

Add -Djava.net.preferIPv4Stack=true to the VM options. Another way to confirm if it is the same issue, in Netbeans, right click on the project > properties > Libraries and choose a JDK 6 Java Platform (install if you do not have it). Clean, build then try again. This will eliminate this issue as the problem

Credit https://stackoverflow.com/a/7478027/643500

Leave a Comment