How do you get the ethernet address using Java?
问题 I would like to retrieve the ethernet address of the network interface that is used to access a particular website. How can this be done in Java? Solution Note that the accepted solution of getHardwareAddress is only available in Java 6. There does not seem to be a solution for Java 5 aside from executing i(f|p)confing. 回答1: java.net.NetworkInterface.getHardwareAddress (method added in Java 6) It has to be called on the machine you are interested in - the MAC is not transferred across network