I have three interfaces (eth0,Loopback,wlan0) on my machine and i want to get use Java-API to get the mac address.
I use this code.
<
When calling getNetworkInterfaces Java will return
all the interfaces on this machine. Returns null if no network interfaces could be found on this machine.
You are not the only one with this issue. Apparently, on linux Java will return only the interfaces that have an IP Address allocated (i.e. configured adapters).
But from your application point of view (unless you are building a network configuration application) having an interface without an IP address is like not having it at all. You will have to either poll for interfaces or get them every time you access, say, "Network Preferences" in your application.