I am trying to call C ++ from Java using GCJ using CNI, so far I can call Java code from C ++. How can I call C ++ from Java using CNI?
I am producing a pcent answer somewhat to read the GCJ / CNI Docs .
I believe the key is to understand the concept of the whole “CI Class C ++”.
Most of the documentation describes how Java conventions translate in the CI C ++ class.
Try reading the GCJ / CNI Docs
I am not a good Java programmer, but I am familiar with C # / C ++ interop. The best solution for calling from native C ++ managed managed C # was to use Callbacks . I think this applies to JNI
Try reading: http://www.tidytutorials.com/2009/07/java-native-interface-jni-example-using.html