I'm late here, but I'll add it for future references.
Generics in Java are implemented using Type Erasure, which basically is: generics exists only in compile-time: they are gone after that, not existing in run-time.
This means that, even though you can have a method like public native void blah(E genericOne, F genericTwo)
, when compiled, it is actually converted to public native void blah(Object genericOne, Object genericTwo)
.
This way, you don't need to even care about generics when using the Java Native Interface: everything is converted down to Object
, so you can simply reference them as a jobject
.
The same goes for the Java classes: you can simply reference them as a jclass
.