Wednesday, July 23, 2014

Address is invalid on local machine, or port is not valid on remote machine


This issue is caused generally when your Java attempts to use an IPV6 address, where either OS does not support it or its not set up properly. You may get this issue while running your java program from CMD, Java IDE or when downloading jar dependency using maven etc.

So, to resolve this you just need to tell your java code to use IPV4 instead of IPV6 :)

"To fix when running from Command prompt. Just add the properly as: "
java -Djava.net.preferIPv4Stack=true <Your Java Class to Run>

" TO fix when running from Java IDE. Suppose Intellij IDEA: "
Set the property under Run -> Edit Configuration

No comments:

AWS Certified Solutions Architect Associate - AWS Introduction - Questions

All the Best !!! Show Result !! Try Again !! ×