Can C++ call Java code?

前端 未结 2 728
没有蜡笔的小新
没有蜡笔的小新 2020-12-11 03:06

I know that Java code can call C++ code through JNI. Is it possible, however, to call Java code from C++ again through JNI or with any other method?

2条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-11 04:08

    You can also use SWIG to automatically generate the JNI files. The setup can be a bit tricky but it's very useful when you have a lot of C++ code to expose

    http://www.swig.org/index.php

提交回复
热议问题