I posted a question about a problem that concerns inetaddress in java 8 : InetAddress java 8 is not getting the hostname
however I found a simple solution by using System.getenv("HOSTNAME")
instead of InetAddress.getLocalHost().getHostName()
...
I want to know what is the difference between getting the hostname using :
InetAddress.getLocalHost().getHostName();
or
System.getenv("HOSTNAME")
and is there any impacts? which is better?