How do I fix "java.net.BindException: Can't assign requested address"?

I’d note that the above is not a recommended solution – there are ways around this without changing the hostname.