Making generic calls with JAVA JNI and C++

后端 未结 3 1578
借酒劲吻你
借酒劲吻你 2021-01-13 15:23

I am working with JNI and I have to pass in some generic types to the C++. I am stuck with how to approach this on the C++ side

HashMap

        
3条回答
  •  旧巷少年郎
    2021-01-13 16:14

    The runtime signature is just plain HashMap and ArrayList - Generics are a compile-time thing.

    You can use javah to generate a C header file with correct signatures for native functions.

提交回复
热议问题