I'm displaying network information using a very simple code that uses Java API: NetworkInterface#getHardwareAddress() .
The code is working on Windows XP, XP 64, Debian.
I find two different behaviors on Win 7: computer of my company vs mine.
Information displayed are not the same as ipconfig /all
, I get only the physical address of the last virtual network card.
I reproduce the issue using java 1.6 u32, 1.7 u21 and 1.7 u40 (both versions x86/64): looking at the output, eth3 and eth4 return the wrong mac address.
I think the code is correct: this is the same as suggested on Stack Overflow and the result is correct on my personal computer.
- Does anyone know what parameters might influence the result?
- What settings should I check on Windows to determine differences between different machines?
- Any suggestions ?
ToDo
I will try to disable virtual interfaces then relaunch the tool. (Needs the IT intervention...).