开发者

Java Native Access in JDK 1.3

开发者 https://www.devze.com 2023-03-07 11:14 出处:网络
I\'m trying to integrate JNA into JDK 1.3 application. JNA pages have following on this subject: Supported on 1.4 or later JVMs

I'm trying to integrate JNA into JDK 1.3 application. JNA pages have following on this subject:

Supported on 1.4 or later JVMs (earlier VMs may work with stubbed NIO support)

I've managed to port JNA sources to JDK 1.3 by dropping all java.nio references. I do not need for example java.nio.Buffer.

However, JNA DLLs are compiled开发者_开发知识库 to use Java NIO types and complain accodingly:

JNA: Problems loading core IDs: java.nio.Buffer

What do I need to do to make JNA work in JDK 1.3? What does this "may work with stubbed NIO support" mean?

Is my only option to stub NIO from C source code and recompile DLL? Since I'm not good at C programming at all, I'm desperately trying to avoid it.

Is there some other way to call native DLL in Java (not JNI, called DLL's are closed source and JNI incompatible).


The docs are proposing that you write some fake java.nio classes, and put them on the bootclasspath -- and then don't use anything that requires java.nio. You're not expected to modify the JNA source or edit the native code.


JDK 1.3? That's ridiculously out of support, unless you're running on Solaris 8. EOL started seven years ago and was complete when JDK 6 became available on 6-Nov-2006. That's almost five years back.

Personally, I think your efforts would be better spent porting the code to a more modern JDK. JNA is telling you that it requires NIO. I'd heed the call and port away from JDK 1.3.

0

精彩评论

暂无评论...
验证码 换一张
取 消