How to get MAC address using java code

hi friends
please write me, How can I get MAC Address of local machine using java code.I don't want to use JNI.
Please reply me. Its urgent for me
Thanks in advance
US

You have several ways under *nix
ifconfig -a | grep HWwill output something like
eth0      Lien encap:Ethernet  HWaddr 00:11:FF:74:FF:B4combined with Runtime.getRuntime().exec("")and Process.getInputStream()you should be able to read it easilly.
Under Windows (and Linux of course) try jpcap (http://sourceforge.net/projects/jpcap)
You can also use jnative as a generic tool (http://sourceforge.net/projects/jnative)
--Marc (http://jnative.sf.net)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Similar Messages

  • Isn't possible to get MAC address using java

    I am trying to get the MAC address of my pc using java code. It seems that i am only able to get the ip address. Can anyone help?

    Use JNI or Runtime.exec(). For the latter you would need to find an OS command line tool and then parse the output.

  • How to get printer IPAddress using java code

    Hi all,
    Can some one suggest in java
    1) how to get printer IPaddress
    2) send a printer job to a particular printer either by using printer name or by printer IPaddress ?

    Hi all,
    Can some one suggest in java
    1) how to get printer IPaddress
    2) send a printer job to a particular printer either by using printer name or by printer IPaddress ?

  • How to get MAC address from IP address in LAN

    Hi all,
    How to get MAC address from IP address in LAN (windows or any OS), I would have all IP addresses of my LAN, so I would like to know all MAC address.
    Code examples are highly appreciated.
    Thanks & Regards,
    abel...

    abel wrote:
    Yeah that is only working for local system, but how to get remote system's MAC ..?
    Thanks for quick reply ...
    Edited by: abel on Jan 28, 2009 12:10 AMIt is my understanding that only one person ever found the holy grail which you seek. But sadly [_he's dead_|http://forums.sun.com/profile.jspa?userID=649366]
    As a curious aside how did you manage to get the list of IPs?

  • How to launch Jar file in Mac Os using java code??

    can anyone tell me how can i launch another jar file in my apllication using java code.

    define "launch".
    - You want to run a new java program in a separate process? (see Runtime.exec())
    - You want to run a method in a specific class in the jar? (add jar to application classpath and then simply instantiate the class and call the method)

  • How to get MAC address list and HDD serial number from Windows and MAC machine?

    Hi,
    I'm developing a AIR application. I'm implementing the product key mechanishm. I need to identify the users' machines uniquely. I chose MAC address would be a better way. But a computer has list of MAC addresses including LAN card and Wi-Fi card addresses. So, I need to get the list of available MAC addresses from the computer and the Hard Disk Drive's serial number. HDD serial number would be helpful to cross verify the identity.
    I'm able to get the MAC address using NetworkInfo class. But I need to get a list of available MAC addresses and HDD serial number.
    Is there any classess to accomplish this task?
    Thanks in advance.

    See if this link can be of a little use to you.
    http://www.adobe.com/devnet/air/flex/articles/retrieving_network_interfaces.html#ionComHea ding

  • How to get MAC Address of a stolen laptop by using Serial number?

    Hi my Lenovo G560 laptop was stolen on 17/04/13. I have the serial number. In order to trace the laptop, I need the MAC address. Unfortunately I don't know the MAC address of my stolen laptop. My question is, is it possible to get the MAC address by using serial number? 
    Serial Number: xxxxxxxxxx
    Moderator Note; s/n edited for member's own protection

    hi Subrahmanya,
    Sorry to hear about your trouble. Unfortunately, the only way to get the MAC address is to run a query on the unit (physically or or remotely). Using the serial number to query information on the system will list the devices that are included on the unit (this doesn't include the MAC address).
    Regards,
    neokenchi
    Did someone help you today? Press the star on the left to thank them with a Kudo!
    If you find a post helpful and it answers your question, please mark it as an "Accepted Solution"! This will help the rest of the Community with similar issues identify the verified solution and benefit from it.
    Follow @LenovoForums on Twitter!

  • How to get MAC ADDRESS in mais.asc using FMS

    Hello,
    i need to get the Mac Address of every machine connected to my fms, is that possible with FMS?
    THX

    It's also available in System Information, under the Network section.
    Hold down option and select System Information from the Apple menu.
    Select Network, then the particular service type: Airport, Ethernet, Firewire
    Scroll down till you see MAC Address:
    You can also reveal it in the Terminal with ifconfig. en0 is usually ethernet, en1 is Airport, but that depends on your configuration.

  • How to get Mac Address of Remote Computer

    Hi All,
    I tried to find out a solution for finding Mac Address of a remote system, then first i tried with finding it with local address using the following code it works fine for me.
    public class MacAddressFinder {
         public static void main(String[] args) {
              try
                   InetAddress ipAddr = InetAddress.getLocalHost();
                   System.out.println("Current IP address : " + ipAddr.getHostAddress());
                   NetworkInterface nwIntf;
                   try
                        nwIntf = NetworkInterface.getByInetAddress(ipAddr);
                        byte[] hwAddr = nwIntf.getHardwareAddress();
                        System.out.print("Current MAC address : ");
                        StringBuilder sb = new StringBuilder();
                        for (int i = 0; i < hwAddr.length; i++)
                             sb.append(String.format("%02X%s", hwAddr, (i < hwAddr.length - 1) ? "-" : ""));          
                        System.out.println(sb);
                   } catch (SocketException e) {
                        e.printStackTrace();
              catch (UnknownHostException e) {
                   e.printStackTrace();
    But when i tried this piece of code in jsp with the following code i am getting NeworkInterface object value as null and there by i am unable to get the Mac Address of a remote computer.
    InetAddress ipAddr = InetAddress.getByName(request.getRemoteAddr());
    NetworkInterface nwIntf = NetworkInterface.getByInetAddress(ipAddr);Can you please suggest me how to find out the Mac address of remote system?
    Thanks,
    Uday

    first of all, NetworkInterface only exposes the NetworkInterfaces of the local computer. secondly, you cannot find the mac address of an arbitrary remote computer. that information is not available outside of the local subnet. and java doesn't expose a way to discover it even for computers on the local subnet.

  • How to get repository connection in java code

    Hi!
    I have a method in server-side java code. This is get a repository connection from Weblogic pool.
    private DataSource getDataSource() throws WavesetException {
    DataStore ds = Server.getServer().getRepository().getPrimaryDataStore();
    DataSource dataSource = null;
    if (ds instanceof RelationalDataStore) {
    dataSource = ((RelationalDataStore)ds).getDataSource();
    return dataSource;
    I would like same this, but in the client side. After connection (SessionFactory.getSession...) I get a RemoteSession object.
    How can I get a database (repository) connection?
    Thanks,
    Attila

    com.waveset.util.Util.setWavesetHome("D:\\Tomcat 5.0\\webapps\\idm"); // if you are running this java code out side idm app
    Session session = SessionFactory.getSession("configurator", new EncryptedData("configurator"));
    LighthouseContext lh = session;
    WSUser user = (WSUser) lh.getObject(Type.USER, "Testuser");
    OR use below code
         System.setProperty("waveset.home","D:\\Tomcat 5.0\\webapps\\idm");
    // here we find the path
    LighthouseContext lighthouseContext = new com.waveset.server.InternalSession();
    WSUser user = (WSUser) lighthouseContext.getObject(Type.USER, "Testuser");

  • How to get mac address?

    I have used NetworkInterface.getNetworkInterfaces() for get list of interfaces
    but under xp I not read interface informations.
    Is possible that the problem is permission level of user?
    Thanks.

    Some call in Java are OS dependent and work better on some OS than other. If there is a permissions issue it is at the OS level and Java would not be aware of it. (But I doubt this is the case)
    It is possible that information is not available under windows.
    However you can call "ipconfig /all" and parse the MAC address from that.

  • How to get MAC address from client machine ?

    Hi dear,
    We are implementing security measures for a banking system, so it is required that we track the MAC address of the registered clients along with other parameters. How do we get the MAC address from client machine using ADF or running scripts in client side?
    thanks all

    Hi,
    Welcome to OTN.
    Your question has nothing to do with ADF as such. Googling would give you plenty of such topics.
    -Arun

  • How to get MAC Address for maintaning unique client id at server side?

    Hi All,
    Can somebody tell how can i get MAC id for maintaing Unique client id at server.
    or is there any alternative way to do this?
    Thanks in advance..
    CK

    Usually people just use cookies for that.

  • How to get MAC Address from device?

    Does any one knows, how we can get programmatically the MAC address of Blackberry device?
    Is it possible to get it through BES IT Policy?
    - Thanks

    abel wrote:
    Yeah that is only working for local system, but how to get remote system's MAC ..?
    Thanks for quick reply ...
    Edited by: abel on Jan 28, 2009 12:10 AMIt is my understanding that only one person ever found the holy grail which you seek. But sadly [_he's dead_|http://forums.sun.com/profile.jspa?userID=649366]
    As a curious aside how did you manage to get the list of IPs?

  • How to get MAC address of a phone

    Hi,
    I am able to retrieve phone details by sending Soap request to RisPort. But the response doesn't have MAC address of the phone. Can any one please let me know how to get this information.
    Here is my Soap request
    <?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Body><SelectCmDevice soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><CmSelectionCriteria href="#id0"/><StateInfo xsi:type="xsd:string"/></SelectCmDevice><multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns1:CmSelectionCriteria" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="tns:CmSelectionCriteria"><maxReturnedDevices xsi:type="xsd:unsignedInt">10</maxReturnedDevices><Class xsi:type="soapenc:string">Phone</Class><Model xsi:type="xsd:unsignedInt">255</Model><nodeName xsi:type="soapenc:string"/><selectBy xsi:type="soapenc:string">Name</selectBy><selectItems xsi:type="soapenc:Array" xsi:nil="true"/><status xsi:type="soapenc:string"/></multiRef></soapenv:Body></soapenv:Envelope>

    When you receive the response, you receive the name of the ip phone. The name is something like: SEPXXXXXXXXXXXX where all the X correspond to the MAC address of the phone.

Maybe you are looking for

  • AP 11i : Is it possible to setup a workflow for price or qty holds

    Hello, I would like to know if someone has already setup a workflow in order to manage in the workflow the qty / price hold ? For invoices manually entered. My scenario would be the following : - Match an invoice to a PO, with differences on price or

  • What does output look like

    I have RoboHelp on my computer, and I used an older version years ago. Can I pull in multiple flash/html files and generate an output of one swf file? If so, Robohelp may REALLY solve some of our problems!!!

  • JApplet's stop() not called

    Hi All, My JApplet's stop() method is not called from IE, Chrome or Safari when I switch tabs, but is called along with the destroy() method when I close the tab that includes the applet. Could you please let me know why this behavior occurs? In the

  • Final Cut Express 3.5 surround sound support

    I upgraded to 3.5 from 3.0 with the hope that FCE 3.5 would finally support MPEG-2 with Dolby 5.1 as it says it supports surround sound. Any idea if this is in the plans as FCE for the video part blows away all of the PC stuff but I would really like

  • N79 keys stop working

    When I switch my phone on, it works normally for a while and all the keys work as they should. But then it just suddenly stops working, none of the keys seem to work, except for the power button and camera lense cover. (The camera application starts