I think you can't find such name reliably.
Depending on the level of virtualization, you may be running on bare metal, virtual machine, VM inside of a VM, Docker, or even a custom JVM by some cloud provider which may have additional levels of abstraction and cloud-specific handling of the networking API.
I've been dealing with this in a recent task of identifying a machine to detect when some service instance gets stuck. This has to work both in a hosted test environment and in production in the cloud.
I ended up using the particular cloud provider's API (AWS SDK or Google Cloud Engine API) if it gives anything, or networking API (see @jsight's anwser), and, if that gives IP's like 127.0.0.1 or 192.*, then I used a hash()
of an object that is guaranteed to be just once in any JVM instance.
All of these change may change over time. The goal was to uniquely identify the node at some given moment. If that's your ultimate goal, I hope this helps.