This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
i find that i can use this way to get the ip and host name:
hostInfo = InetAddress.getLocalHost(); ip = hostInfo.getHostAddress(); hostName = hostInfo.getHostName();
but still dont know how to get the MAC address.
Any help? Lester
Joined: Oct 12, 2000
you can't get the MAC address. It's not exposed as you have no business using it. The network is only concerned with ip addresses except at the hardware level which is deeper in the network architecture than what Java is designed to handle.