Is there a way in Java to retrieve the mac address of a local computer?
Real Gagnon - 20 Sep 2005 22:11 GMT
> Is there a way in Java to retrieve the mac address of a local computer?
Not in pure Java. Without using a JNI routine, one way is to launch the
appropriate external utility for your OS and capture/parse the output.
For example :
Win98 : arp -a
Win Nt/2K/XP : ipconfig /all
Bye.

Signature
Real Gagnon from Quebec, Canada
* Looking for Java or PB code examples ? Visit Real's How-to
* http://www.rgagnon.com/howto.html
Thomas Hawtin - 20 Sep 2005 22:25 GMT
> Is there a way in Java to retrieve the mac address of a local computer?
Java SE 6 will have java.net.NetworkInterface.getHardwareAddress.
Tom Hawtin

Signature
Unemployed English Java programmer
http://jroller.com/page/tackline/
Roedy Green - 21 Sep 2005 00:40 GMT
>Is there a way in Java to retrieve the mac address of a local computer?
I is incredibly difficult to do. It requires JNI and reams and reams
and reams of Windows API gobbledegook. I don't know anyone who has
had the patience. I might be persuaded for a fee.

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
Jeff Schwab - 21 Sep 2005 02:54 GMT
>>Is there a way in Java to retrieve the mac address of a local computer?
>
> I is incredibly difficult to do. It requires JNI and reams and reams
> and reams of Windows API gobbledegook. I don't know anyone who has
> had the patience. I might be persuaded for a fee.
Why necessarily Windows?
Roedy Green - 21 Sep 2005 03:43 GMT
>Why necessarily Windows?
Usually that the most common platform people want JNI for, Solaris
next, then Linux. IF you don't wait for Java 1.6, you have to solve
the problem separately for each OS.

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.