使用 JNA 调用 dll 库,因为 dll 库是32 位的,而 jvm 是 64位的,所以发生的错误:

java.lang.UnsatisfiedLinkError: Unable to load library 'xxx': Native library (win32-x86-64/ID_Fpr.dll)

,必须使用 32 位的 Jvm 才行。

参见 http://stackoverflow.com/questions/14286647/trying-to-use-dll-from-java-jna-unable-to-load-library-exception

I had exactly the same problem with loading a DLL, I solved it in this way:

  • As Christian Kuetbach said, check if the simpleDLL you are using is compatible with your processor's architecture, a 32-bit DLL won't work on a 64-bit machine, and also a 64-bit DLL won't work on a 32-bit machine.
  • If the DLL is compatible, then the problem may be in your java library path. I put my DLL into the user.dir directory and then I used this code:

    Set Java library path to user.dir or maybe another path you want:

    String myLibraryPath = System.getProperty("user.dir");//or another absolute or relative path
    
    System.setProperty("java.library.path", myLibraryPath);

    Load the library:

    System.loadLibrary("libraryWithoutDLLExtension");

It worked for me, try it and tell me if it works for you.

Please check if the simpleDLL is 32 or 64 bit. Then check, if the JVM is also 32 or 64 bit. They have to be for the same platform.

You may also specify an absolute path, if you change loadLibrary() to load():http://www.chilkatsoft.com/p/p_499.asp

===================

java.lang.UnsatisfiedLinkError: Unable to load library 'ID_Fpr': Native library (win32-x86/ID_Fpr.dll)

表示 dll 库找不到,而不是 32 位 和 64位的冲突。

最新文章

  1. 微信扫码支付~官方DEMO的坑~参数不能自定义
  2. linux Makefile编写的整理
  3. 地图编辑器V2.3
  4. Codeforces Round #197 (Div. 2)
  5. CentOS命令登录MySQL时,报错ERROR 1045 (28000):
  6. boot/head.S
  7. 永久改动redhat的default route
  8. ZOJ 1008 Gnome Tetravex(DFS)
  9. 转载LINQ TO Entity 在数据库发生更改时更新实体数据模型 .edmx 文件
  10. 20165226 预备作业3 Linux安装及学习
  11. BZOJ_3110_[Zjoi2013]K大数查询_整体二分+树状数组
  12. ArcGIS API for JavaScript 入门教程[0] 目录
  13. K-means算法应用:图片压缩
  14. Java并发编程:什么是CAS?这回总算知道了
  15. [ovs][dpdk] ovs-dpdk, dpdk port 大量丢包
  16. 批量Excel数据导入Oracle数据库 导入excel错误:外部表不是预期的格式 解决方案
  17. Linux环境下的Scala环境搭建
  18. jq上下级元素查找方法
  19. [转] 用协议分析工具学习TCP/IP
  20. VC++编程之道读书笔记

热门文章

  1. 【Java每日一题】20161027
  2. 泛函编程(28)-粗俗浅解:Functor, Applicative, Monad
  3. Fiddler (二) Script 用法
  4. Java final数据
  5. javascript模板库jsrender for循环嵌套示例
  6. ajax传参到实体类对应字段
  7. ADO.NET(数据访问技术)
  8. Microsoft SQL Server Compact 4.0&&ADO.NET Entity Framework 4.1&&MVC3
  9. 创业小坑:内网域名 在windows下能nslookup,但ping不通,也无法访问。而在linux下正常。
  10. Permit.js – 用于构建多状态原型的 jQuery 插件