全网首发:There is an incompatible JNA native library installed on this system/6.1.2/4.0.1

简介: 全网首发:There is an incompatible JNA native library installed on this system/6.1.2/4.0.1

这个错误很难遇到。吾也是编译JNA才遇到。网上查了半天,完全无用。后来反复思考实验,终于成功解决。


 错误原因,就是你使用的jna.jar中的libjnidispatch.so编译有问题。去下载一个别人编译好的jna.jar即可。比如:


支持loongarch64的jna-5.10.0.zip-Java文档类资源-CSDN下载


 如果是编译,解决之前很难,解决之后就会发现,原来如此简单。具体解决办法(在jna的native目录):


编译产生头文件

ant javah

修改Makefile

大约50行:

# JNA_JNI_VERSION=4.0.1 # auto-generated by ant
JNA_JNI_VERSION=6.1.2 # auto-generated by ant

编译libjnidispatch.so

# 注意必须使用make
make

打包linux-loongarch64.jar

复制linux-mips64el.jar。


改名为linux-loongarch64.jar


打开新jar,使用jna目录的build/native-linux-loongarch64的libjnidispatch.so替换jar中的同名文件


把包linux-loongarch64.jar复制到jna目录的lib/native下

重新编译

产生的jna.jar就正确了。

目录
相关文章
|
4月前
|
Java 开发工具
开发工具系类 之 Cannot determine path to ‘tools.jar‘ library for 17 (D:/Program Files/Java/jdk-17.0.9)
这篇文章讲述了作者在升级JDK至17版本后遇到IDEA无法识别`tools.jar`的问题,并提供了两种解决方法:升级IDEA版本或降低JDK版本,并提供了相关版本的IDEA兼容性信息。
开发工具系类 之 Cannot determine path to ‘tools.jar‘ library for 17 (D:/Program Files/Java/jdk-17.0.9)
|
Java Linux 计算机视觉
全网首发:Could NOT find JNI (missing: JAVA_AWT_INCLUDE_PATH) 解决办法
全网首发:Could NOT find JNI (missing: JAVA_AWT_INCLUDE_PATH) 解决办法
355 0
|
4月前
|
Java
cxf 动态调用 WebService No compiler detected, make sure you are running on top of a JDK instead of a JRE
cxf 动态调用 WebService No compiler detected, make sure you are running on top of a JDK instead of a JRE
81 0
|
Java 应用服务中间件 Apache
An incompatible version [1.2.7] of the APR based Apache Tomcat Native library is installed
An incompatible version [1.2.7] of the APR based Apache Tomcat Native library is installed
An incompatible version [1.2.7] of the APR based Apache Tomcat Native library is installed
全网首发:编译jna:dispatch.h:30:34: fatal error: com_sun_jna_Function.h: 没有那个文件或目录
全网首发:编译jna:dispatch.h:30:34: fatal error: com_sun_jna_Function.h: 没有那个文件或目录
91 0
|
Java
全网首发:There is an incompatible JNA native library installed on this system/6.1.2/4.0.1
全网首发:There is an incompatible JNA native library installed on this system/6.1.2/4.0.1
222 0
java.lang.UnsatisfiedLinkError: Library not loaded: @rpath/libo.dylib Reason: image not found
java.lang.UnsatisfiedLinkError: Library not loaded: @rpath/libo.dylib Reason: image not found
100 0
|
Java
java.lang.UnsatisfiedLinkError: JNA support (com/sun/jna/android-arm/libjnidispatch.so) not found
java.lang.UnsatisfiedLinkError: JNA support (com/sun/jna/android-arm/libjnidispatch.so) not found
212 0
JRebel-JVMTI [ERROR] You’re using an incompatible ‘jrebel.jar’ with the JRebel Agent.【完美解决方案】
JRebel-JVMTI [ERROR] You’re using an incompatible ‘jrebel.jar’ with the JRebel Agent.【完美解决方案】
JRebel-JVMTI [ERROR] You’re using an incompatible ‘jrebel.jar’ with the JRebel Agent.【完美解决方案】
|
Python
Cannot mix incompatible Qt library (version 0x50907) with this library (version 0x50e02)
Cannot mix incompatible Qt library (version 0x50907) with this library (version 0x50e02)
817 0