0

I've installed a 64 bit version of jpcap.dll, it seems to work fine, I can get a list of my devices with JpcapCaptor. But I have an error at openDevice... Here is my code :

public class Main {

    public static void main(String[] args) {
        NetworkInterface[] devices = JpcapCaptor.getDeviceList();
        try {
            JpcapCaptor captor = JpcapCaptor.openDevice(devices[1], 65535, false, 20);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

The error says : "java.lang.NoSuchMethodError: setRoutingOption"

I don't know what I did wrong. Could it be from the dll ?

EDIT: here is the list:

0: \Device\NPF_{8B9933B7-3C46-4A4E-95D2-653B8602A770}(Sun)
 datalink: EN10MB(Ethernet)
 MAC address:8:0:27:0:f0:e5:
 address:/fe80:0:0:0:b003:4e05:c35f:adc5 null null
 address:/192.168.56.1 /255.255.255.0 /255.255.255.255
1: \Device\NPF_{FDEF9FDE-2BEA-4C5C-8760-AD6DEF0EFC43}(Microsoft)
 datalink: EN10MB(Ethernet)
 MAC address:1c:65:9d:7a:cf:d7:
 address:/fe80:0:0:0:39f5:e1e8:faa5:aac1 null null
 address:/192.168.0.35 /255.255.255.0 /255.255.255.255
2: \Device\NPF_{9035FA42-9672-47A1-A179-98C7ABA89DE8}(Atheros L1C PCI-E Ethernet Controller)
 datalink: EN10MB(Ethernet)
 MAC address:b8:70:f4:ab:f8:be:
 address:/fe80:0:0:0:5d04:6a8d:1c78:5c59 null null
 address:/0.0.0.0 /255.0.0.0 /255.255.255.255

Thanks

4aRk Kn1gh7
  • 4,259
  • 1
  • 30
  • 41
omaflak
  • 165
  • 1
  • 1
  • 9
  • are you running it as administrator? And can you also provide the list of the devices in the question? – 4aRk Kn1gh7 Jul 19 '14 at 11:53
  • I don't think so. Do I need to run Eclipse as administrator or just the program ? – omaflak Jul 19 '14 at 11:55
  • If you are using an IDE then launch the IDE as administrator and then test your program. – 4aRk Kn1gh7 Jul 19 '14 at 11:59
  • I tried with the admin access and it did not work :/ I also tried to switch between all the devices and it didn't wotked too... Any ideas ? – omaflak Jul 19 '14 at 12:02
  • this means that its a library problem. Some library files might be missing. Do you have winpcap installed? – 4aRk Kn1gh7 Jul 19 '14 at 12:04
  • Ok, and is there a way to use the 32 bit version, i think i am not using an official one... I have a Windows 7 64 bit – omaflak Jul 19 '14 at 12:07
  • Yes I have Winpcap... Why jpcap.jar isn't enought to use the library ? – omaflak Jul 19 '14 at 12:09
  • jpcap is a java wrapper which uses the library libpcap/winpcap written in c++ by making native library calls. So in reality the jar alone is nothing without the native c library which is providing the main functionality – 4aRk Kn1gh7 Jul 19 '14 at 12:16
  • Try using the jar file and the dll from here: http://www.sipinspector.com/download/jpcap/jpcap-0.7.tar.gz?attredirects=0&d=1 – 4aRk Kn1gh7 Jul 19 '14 at 12:23
  • It says : Can't load IA 32-bit .dll on a AMD 64-bit platform – omaflak Jul 19 '14 at 12:47
  • Well that the answer to your 32-bit question. You can try running with the new jar and the 64-bit dll. I'm pretty sure the problem is because of some missing libraries now. – 4aRk Kn1gh7 Jul 19 '14 at 12:54

0 Answers0