0

I have Windows 7 (32 bit) installed on my Laptop. I am running the below code on Eclipse Juno :

import jpcap.JpcapCaptor;     
import jpcap.NetworkInterface;

public class Network {

   public static void main(String[] args) {

   NetworkInterface[] devices = JpcapCaptor.getDeviceList();

   System.out.println("No. of Network devices : "+devices.length);    
   }    
}

I have 2 network adapters and have administrative privileges

But I get the result as: No. of Network devices : 0

Can someone please help with what could be issue?

Lennart
  • 9,657
  • 16
  • 68
  • 84

1 Answers1

2

Ok. I finally got the answer. Just having the user account with administrative privileges is not enough, I still had to right click on eclipse and select "Run as administrator" and then when I execute the above program, I get the correct no. of network devices