Dear Dudes,
I want to open the DLL files. i need the solution
Welcome to the Java Programming Forums
The professional, friendly Java community. 21,500 members and growing!
The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.
>> REGISTER NOW TO START POSTING
Members have full access to the forums. Advertisements are removed for registered users.
Dear Dudes,
I want to open the DLL files. i need the solution
Moved to the JNI section.
If you don't understand my answer, don't ignore it, ask a question.
Do you want to invoke functions in a DLL? Ok but keep in mind that JNI (Java Native Interface) is a technology to invoke functions in native shared libraries ("DLL" or whatever is in another O.S.) but these libraries must be developed expressely for JNI because they must comply with a lot of conventions of JNI. In other words, JNI is not able to access any shared library!
There is a project called JNA (https://github.com/twall/jna), I don't know if it's still alive/valid or not, I have tried it years ago. JNA can access any shared library because JNA is a "bridge" between Java and the native library, using JNI under the hood. Using JNA you don't need to know about JNI, but you still need to know which are the native functions to invoke, what they receive/return, what types, etc... because you have to "map" these things in a Java interface.
Please, clarify which shared library you want to use, which O.S. (I deduce Windows), which functions.
And also which is your knowledge about Java and native functions developed in C/C++ (use of JNI/JNA is an advanced concept, not for newbies).
Andrea, www.andbin.net — SCJP 5 (91%) – SCWCD 5 (94%)
Useful links for Java beginners – My new project Java Examples on Google Code
To call a function in a native library you have to declare a method in your java class as native with the java keyword native. The declaration of this method must not have a body.
The name of the function exported from your DLL must match the following pattern: Java_classname_methodname where classname is the name of the class where you declared the native method methodname.