Need to identify local machine somehow in java
问题 I'm trying to find out the name of the local machine (or some other way of uniquely identifying a particular machine) that an application is running on. I've been using this: String hostname = java.net.InetAddress.getLocalHost().getHostName(); which works fine, but I just happened to notice in the profiler that it's taking quite a bit of time to execute that so I was wondering if there was something functionally similar that ran more quickly. Doesn't have to be host name, could be anything as