Hi, I have some dll files(not custom and not written by me) and I need to use the functions, that are c/c++ written, in these files in my java project. I googled and read many examples about JNI but they were all about writing your own program and dll and then reaching them. Also I don't think dllexport exists in these dlls, so dllimport/dllexport method is not available I guess. How can I reach these functions? Thanks in advance..
+1
A:
I'm sure, you looked at the JNI Tutorial at oracle already. I had a quick look at the part, where a native function is implemented and a dll is compiled and I don't think, that special conditions have to be met.
I'd give it a try with a single, easy function from that dll:
- Write a simple class with just main method that uses one of the native methods (with easy parameters to have an easy start)
- Generate the header file and
- run the test application
If the dll is not 'jni compliant' (whatever that means), you'll know by then and then you probably know that you have to recompile the native code.
Andreas_D
2010-07-13 07:42:38
And if the source code for the DLL is not available, write some 'native' source code that calls the DLL.
reinierpost
2010-07-13 07:54:07