使用System.loadLibrary()时出现不满意的链接错误? [英] Unsatisfied Link Error when using System.loadLibrary()?
本文介绍了使用System.loadLibrary()时出现不满意的链接错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
出于某种原因,我在我的java应用程序中遇到了令人讨厌的不满意的链接错误。
For some reason, I'm getting a pesky Unsatisfied Link Error in my java app.
这是有问题的罪犯:
System.loadLibrary("psjw");
尽管库psjw.dll显然与此类在同一个源包中。
Despite the library psjw.dll clearly being in the same source package as this class.
请帮忙。
推荐答案
确保你的PATH上有psjw.dll或java.library.path。
Make sure the psjw.dll is either on your PATH or java.library.path.
例如:psjw.dll可能在/ usr / lib中,那么你的命令就是
java -Djava.library.path = / usr / lib ur。 package.UrClass
Ex: psjw.dll may be in /usr/lib then your command would be java -Djava.library.path=/usr/lib ur.package.UrClass
使用精简课程测试您的设置:
Test your setup using a stripped down class:
public class TestLoadLibrary {
public static void main(String[] args) {
String libPath = System.getProperty("java.library.path");
System.out.println("java.library.path=" + libPath);
String libraryName = "psjw";
System.out.println("Trying to load '" + libraryName + "'");
System.loadLibrary(libraryName);
}
}
这篇关于使用System.loadLibrary()时出现不满意的链接错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文