不受支持的 JNI 版本 0xFFFFFFFF [英] unsupported JNI version 0xFFFFFFFF

查看:42
本文介绍了不受支持的 JNI 版本 0xFFFFFFFF的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有人在使用 Java 代码中的本机 dll 时遇到该错误?它是JNI库的版本吗?还是未解决的依赖关系?

has anyone encountered that error while using native dll from java code? Is it the version of the JNI library? or an unresolved dependency?

错误:

Caused by: java.lang.UnsatisfiedLinkError: unsupported JNI version 0xFFFFFFFF required by C:\jnwasapi.dll
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary1(Unknown Source)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)

这是我正在使用的一个新库,其他库工作正常.

This is a new library I'm using, the others working fine.

推荐答案

jnwasapi.dllJNI_OnLoad 函数可能返回 -1,这不是预期的价值.JNI_OnLoad 函数必须返回一个带有已知常量的 jint,例如 JNI_VERSION_1_6.JNI_OnLoad 函数在初始化失败时返回 -1 是很常见的.例如,它可能试图加载一个找不到的类.

The jnwasapi.dll's JNI_OnLoad function is probably returning -1, which is not an expected value. The JNI_OnLoad function must return a jint with a known constant, such as JNI_VERSION_1_6. It's common for JNI_OnLoad functions to return -1 if they fail to initialize. For example, it may have tried to load a class which couldn't be found.

这篇关于不受支持的 JNI 版本 0xFFFFFFFF的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆