java - LoadLibrary 在 NetBeans 中找不到 .dll

标签 java dll netbeans javabeans

我尝试通过此代码加载 SFmpq.dll

static {
    Native.setProtected(true);
    System.setProperty("jna.library.path",
            new File("lib").getAbsolutePath());
    System.out.println(System.getProperty("jna.library.path"));
    INSTANCE = (SFmpq)   Native.loadLibrary("SFmpq", SFmpq.class);
}

它被执行,文件夹和文件存在,但我仍然收到此错误:

C:\Users\Frotty\Documents\NetBeansProjects\Optimizer\lib Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: Unable to load library 'SFmpq': The specified module could not be found.

我把代码和 .dll 给了我的一个 friend ,他将它导入到 Eclipse 中,在那里它工作得非常好。 谁能发现我的错误或者如何正确导入 .dll?

最佳答案

如果您尝试在 64 位系统上加载 32 位库,可能会出现此错误。

关于java - LoadLibrary 在 NetBeans 中找不到 .dll,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6821163/

相关文章:

java - 如何在java中使用for或while方法调用枚举?

java - Netbean java 图形用户界面

android - NetBeans Android 插件出错

c++ - 在 netbeans 中使用 visual studio c++ 编译器

java - 什么时候在 Java 中使用 printf 语句?

java - 这些循环听起来是否正确,还是应该切换为for或while循环?

c++ - 嵌套 DLL 包含 Visual Studio 中的配置

c# - 扩展现有接口(interface)

python - Python可以调用DLL中的Delphi函数吗?

xslt - 从 Java Servlet 读取文件