开发者

How to use .dll in Java ME

开发者 https://www.devze.com 2023-01-02 11:57 出处:网络
I want to make use of dll in Java ME. Is there any way to do this? I am working in j2me. Problem is j2me won\'t support jni (Java Native Interface). I need to 开发者_如何转开发have any tools to conve

I want to make use of dll in Java ME. Is there any way to do this?

I am working in j2me. Problem is j2me won't support jni (Java Native Interface). I need to 开发者_如何转开发have any tools to convert .dll to .jar


You have to go through JNI: Java Native Interface.

Have a look at calling from a .dll using Java and JNI / Making Native Windows API calls from within a Java Application .

A jar-file is nothing more than a ZIP-file containing Java-class-files. If you have a .dll it will typically contain Windows-specific method calls etc, which have no counterpart in the Java-API (especially not in the J2ME API :-), so, the unhelpful answer is: no, there is no way you can convert a .dll to a .jar that could be used in your J2ME application.


You can call code in a DLL via the Java Native Interface, but that in no way constitutes "converting to .jar".

0

精彩评论

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

关注公众号