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

那年仲夏 提交于 2019-11-26 15:28:26
Hitham S. AlQadheeb

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

In case to simplify app invocation (e.g. from CLI) used in the code at start:

System.setProperty("java.net.preferIPv4Stack", "true")

supposing that the app will be working with legacy IPv4 network stack.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!