Java错误 - 在java.library.path中找不到库? [英] Java error - cannot find library in java.library.path?
问题描述
我收到如下错误消息:
无法加载库 libraryname .dll通过Windows。使
确保库位于Path环境变量中。线程mainjava.lang.UnsatifiedLinkError中的异常
:
java.library.path中没有 libraryname 。
The library libraryname.dll could not be loaded by Windows. Make sure that the library is in you Path environment variable. Exception in thread "main" java.lang.UnsatifiedLinkError: no libraryname in java.library.path.
此错误来自于我尝试通过cmd在Windows XP上运行jar文件。我想知道,java.library.path究竟在哪里?我已经在我的PATH中添加了C:\Program Files \ Java \ _ddk1.6.0_26但它仍然给我错误。你会如何调试这个?
This error is from me trying to run a jar file on Windows XP via cmd. I am wondering, where exactly is java.library.path? I've already added C:\Program Files\Java\jdk1.6.0_26 to my PATH but it still gives me the error. How would you go about debugging this?
谢谢。
推荐答案
您只需传递java.library即可。 path作为系统属性,如下所示:
You can simply pass java.library.path as a system property as shown below:
java -Djava.library.path=<path_to_dll> <main_class>
首先,您需要找出libraryname.dll的位置,并将其添加到path_to_dll中。
First you need to find out where the libraryname.dll is and add it above in "path_to_dll".
这篇关于Java错误 - 在java.library.path中找不到库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!