java.lang.UnsatisfiedLinkError: Unable to load library 'xxx': Native library (win32-x86-64/ID_Fpr.dll)
使用 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位的冲突。
java.lang.UnsatisfiedLinkError: Unable to load library 'xxx': Native library (win32-x86-64/ID_Fpr.dll)的更多相关文章
- 开发错误记录13:java.lang.UnsatisfiedLinkError: Couldn't load xxx.so: findLibrary returned null
今天在导入环信开发包时,编译报如下错: java.lang.UnsatisfiedLinkError: Couldn't load hyphenate_av from loader dalvik.sy ...
- ubuntu 12.04 x86_64:java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons
sy@sy-Aspire-:~$ .0_155965261/configuration/.log !SESSION -- ::39.595 ------------------------------ ...
- Android中运行的错误:java.lang.UnsatisfiedLinkError: Couldn't load locSDK3: findLibrary returned null.
---恢复内容开始--- 明明已经加入了liblocSDK3.so,但总是无法定位.提示错误java.lang.UnsatisfiedLinkError: Couldn't load locSDK3: ...
- java.lang.UnsatisfiedLinkError: Couldn't load hyphenate_av from loader dalvik.system.PathClassLoader
android studio引入第三方库时报如下异常. 06-15 16:50:24.477 9497-9497/easemobim.test.com.easemobim E/AndroidRunti ...
- java.lang.UnsatisfiedLinkError: Couldn't load vi_voslib from loader dalvik.system.PathClassLoader
加载手机视频查看的JAR包时 运行提示 java.lang.UnsatisfiedLinkError: Couldn't load vi_voslib from loader dalvik.syste ...
- android 高德地图API 之 java.lang.UnsatisfiedLinkError: Couldn't load amapv3: findLibrary returned null错误
错误场景: 运行android app时,在运行到调用高德地图API时,出现 “java.lang.UnsatisfiedLinkError: Couldn't load amapv3: findLi ...
- Android中执行的错误:java.lang.UnsatisfiedLinkError: Couldn't load locSDK3: findLibrary returned null.
今天在使用百度地图的时候执行发现报错: 明明已经增加了liblocSDK3.so.但总是无法定位.提示错误java.lang.UnsatisfiedLinkError: Couldn't load l ...
- 用idea+maven编译打包spark project core错误:java.lang.RuntimeException: Unable to load a Suite class
Discovery starting. *** RUN ABORTED *** java.lang.RuntimeException: Unable to load a Suite class tha ...
- Caused by: java.lang.UnsatisfiedLinkError: Couldn't load 。。。。
最近需要做个有地图搜索功能的模块,用到百度地图SDK,但是从官网上下载SDK后导入工程,修改apiKey后,还是无法运行,总是抱这个错误:Caused by: java.lang.Unsatisfie ...
随机推荐
- 删除Android包
Android删除包有很多种方法,其中一种通过Intent删除,代码如下: public boolean unload (String n){ boolean res = true; try{ // ...
- 纯灌水Linus主义
卖桃君重新整理了Linus的相关故事,在此摘选对自己有触动的内容. 关于生命的意义,李纳斯的解释是,有三件事具有生命的意义.它们是你生活当中所有事情的动机.第一是生存,第二是社会秩序,第三是娱乐.生活 ...
- [转]以Facebook为案例剖析科技公司应有的工具文化
原文:http://36kr.com/p/146507.html 这是一篇几年前的文章,但对于没有涉及到工具文化这个概念的人来说,还是很新的. 前言 前段时间和大众点评的 CEO 张涛聊天的时候碰到内 ...
- Spring中的通知(Advice)和顾问(Advisor)
在Spring中,目前我学习了几种增强的方式,和大家分享一下 之前的话: 1.AOP (Aspect Oriented Programming 面向切面编程) 在软件业,AOP为Aspect O ...
- Windows 安装启动apache时出现错误的解决方法
配置安装Apache主服务发生错误:(OS 5)拒绝访问. : AH00369: Failed to open the Windows service manager, perhaps you fo ...
- Bash中的任务(job)管理
本来不准备写这篇博客的,因为任务管理(job管理)非常非常常用,以至于觉得根本没有必要去写这样一个东西.但想了下,还是记录一下吧,也许有人会用到呢. 不知你是否碰到过这样的情况,当你兴致勃勃的打开VI ...
- Java经典实例:把字符串解析为日期时间
Java版本:1.8开始 import java.time.LocalDate; import java.time.LocalDateTime; /** * Created by Frank */ p ...
- 每天一命令 git checkout
检出 checkout 是git常用命令之一.主要用于创建切换分支,覆盖本地修改等 git checkout 用于显示工作区,暂存区,版本库中文件的区别 git checkout -b branch ...
- aviator使用手册在线
Aviator是一个高性能.轻量级的 java 语言实现的表达式求值引擎, 主要用于各种表达式的动态求值.现在已经有很多开源可用的 java 表达式求值引擎,为什么还需要 Avaitor 呢? Avi ...
- 初学File类
对File类的基本方法的理解 今天刚开始学了File类 一开始看思想编程看得迷迷糊糊的,之后受不了了,直接去看API文档 归纳: File->java.util File类的主要方法: 构造方法 ...