Java jpcap opendevice error, setRoutingOption

282 Views Asked by At

I was messing a lot around with networking and raw sockets. I installed Jpcap and I tried some example code. When I tried the code to send a message with UDP, I got some errors with opening a device. First, the devices are getting stored.

NetworkInterface[] devices = JpcapCaptor.getDeviceList();

Next the first device is tried to open, and that is the line of the error.

JpcapSender sender=JpcapSender.openDevice(devices[0]);

This is the error I got:

java.lang.NoSuchMethodError: setRoutingOption
     at jpcap.JpcapSender.nativeOpenDevice(Native Method)
     at jpcap.JpcapSender.openDevice(JpcapSender.java:38)
     at Test.main(Test.java:15)
 Exception in thread "main"

I have been looking around, but I could not find a solution that worked for me, hopefully you can help me.

1

There are 1 best solutions below

0
Dev125 On

You should use the latest version of Jpcap 0.7 :

http://jpcap.gitspot.com/jpcap-0.7.zip