1753723 Members
4785 Online
108799 Solutions
New Discussion юеВ

Re: JAVA Programming

 
SOLVED
Go to solution
JUAN VIDAL_1
Advisor

JAVA Programming

Which is the alternative of "getHardwareAddress" for HP-UX?

code:
-----
import java.io.*;
import java.net.*;
import java.util.*;

NetworkInterface ni = NetworkInterface.getByInetAddress(addr);
byte[] mac = ni.getHardwareAddress();
compilation error:
------------------

nsfu.java:33: cannot find symbol
symbol : method getHardwareAddress()
location: class java.net.NetworkInterface
byte[] mac = ni.getHardwareAddress();
^


thanks a lot for your help.

Juan.
2 REPLIES 2
Matti_Kurkela
Honored Contributor
Solution

Re: JAVA Programming

What's the version of Java you're using?

NetworkInterface.getHardwareAddress() is one of the new features of Java 6 (aka 1.6) series.

If you're using Java 1.5 (as in your earlier question, I think) there is no standard way to access the hardware parameters of network interfaces.

MK
MK
JUAN VIDAL_1
Advisor

Re: JAVA Programming

Java version is 1.5, is there any alternative?

Thanks!

Juan.