全网首发: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就正确了。

目录
相关文章
|
1月前
|
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)
|
4月前
|
自然语言处理 IDE Java
GraalVM IllegalArgumentException: A language with id ‘xx‘ is not installed. Installed languag
GraalVM IllegalArgumentException: A language with id ‘xx‘ is not installed. Installed languag
64 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
codeblocks中出现#error This file requires compiler and library support for the错误时的解决方案
codeblocks中出现#error This file requires compiler and library support for the错误时的解决方案
622 0
codeblocks中出现#error This file requires compiler and library support for the错误时的解决方案
|
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
193 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
88 0
【错误记录】发布 Flutter 插件包报错 ( ‘gmail.com‘ has insufficient permissions to upload new versions of package)
【错误记录】发布 Flutter 插件包报错 ( ‘gmail.com‘ has insufficient permissions to upload new versions of package)
272 0
【错误记录】发布 Flutter 插件包报错 ( ‘gmail.com‘ has insufficient permissions to upload new versions of package)