There is a third part dll with definitions of a class in C++ which I’ve to use in Java. I’ve the complete knowledge of the public methods in the dll. Now to use these I’m kind of using a wrapper C++ program, which creates the object and calls the functions in the dll when required. And I interface this C++ code with the Java using JNI. Is there any other efficient way of doing this. That is to create objects of a class and use its functions directly using JNI or any other library in Java
Share
In order to call native(C/C++) code from Java, You will have to do Marshalling of the objects between native world and Java, JNI justs does that and your approach just looks right to me.