简体   繁体   English

Java jpcap opendevice错误,setRoutingOption

[英]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. 我安装了Jpcap,并尝试了一些示例代码。 When I tried the code to send a message with UDP, I got some errors with opening a device. 当我尝试使用UDP发送消息时,我在打开设备时遇到了一些错误。 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 : 您应该使用最新版本的Jpcap 0.7:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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