简体   繁体   中英

Java jpcap opendevice error, setRoutingOption

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.

You should use the latest version of Jpcap 0.7 :

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM