Looking for a convenient way to call Java from C++

前端 未结 9 868
醉话见心
醉话见心 2021-01-30 13:55

It seems most documentation or helper libraries relating to JNI (Java Native Interface) are concerned with calling native code from Java. This seems to be the main use of it, ev

相关标签:
9条回答
  • 2021-01-30 14:34

    I had pretty much the same problems, ended up doing it on my own, maybe this helps someone.

    https://github.com/mo22/jnipp

    It has a small runtime footprint (<30kb), manages references, and supports generating Java class interfaces. I.e. LocalRef> stringArray; and then using stringArray[1]->getBytes() or something.

    0 讨论(0)
  • 2021-01-30 14:37

    What about using Thrift or Protocol Buffers to facilitate your Java to C++ calls?

    0 讨论(0)
  • 2021-01-30 14:38

    Since CORBA doesn't seem to be what you want, here are links describing how to start JVM from C/C++ and calling JAVA-methods.

    http://java.sun.com/docs/books/jni/html/invoke.html and http://java.sys-con.com/node/45840

    PS: When interfacing Java with C++ you should also have a look at JNA or bridj.

    0 讨论(0)
提交回复
热议问题