线程“main”中的异常 java.lang.UnsatisfiedLinkError:java.library.path 中没有 jpcap

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13806199/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-31 14:03:09  来源:igfitidea点击:

Exception in thread "main" java.lang.UnsatisfiedLinkError: no jpcap in java.library.path

javanetbeansjpcap

提问by Asad Ikram

i am using netbeans ide and trying to capture packets using jpcap library. my program used to run correctly before bu suddenly this error

我正在使用 netbeans ide 并尝试使用 jpcap 库捕获数据包。我的程序曾经在突然出现此错误之前正常运行

Exception in thread "main" java.lang.UnsatisfiedLinkError: no jpcap in java.library.path

is appearing. i have tried ds on my other computer too but in vain .. i have added jpcap library and before installing i cleared older version completely. have done everythng available .i am seriously in trouble

正在出现。我也在我的另一台电脑上尝试过 ds 但没有成功..我已经添加了 jpcap 库,在安装之前我完全清除了旧版本。已经做了所有可用的事情。我遇到了严重的麻烦

please help!

请帮忙!

回答by Isaac

Add this to the beginning of your program:

将此添加到程序的开头:

System.out.println(System.getProperty("java.library.path"));

System.out.println(System.getProperty("java.library.path"));

You should get a list of directories. Your jpcap's DLL(or soon UNIX) must be in one of these directories in order for your program to work. If it is not there, then either:

你应该得到一个目录列表。您的jpcap's DLL(或so在 UNIX 上)必须位于这些目录之一中,才能使您的程序正常工作。如果它不存在,那么要么:

  • Add the directory containing that DLL/soto your system's PATH(preferred).
  • Add the DLL/sointo one of the directories printed.
  • 将包含该DLL/的目录添加so到您的系统PATH(首选)。
  • DLL/添加so到打印的目录之一中。