Get Your Machine's MAC Address
Join the DZone community and get the full member experience.Join For Free
// Only gets the address for the first net interface, if you have more than one you'll need to get the list // and decide which you want to use.
InetAddress add = InetAddress.getLocalHost(); NetworkInterface ni = NetworkInterface.getByInetAddress( add ); byte mac = ni.getHardwareAddress();
Opinions expressed by DZone contributors are their own.