I have a JNI method to access java method which returns an Integer object. I do not want to return the primitive int type because this code will be modified to handle Generi
You have to invoke the intValue method on the Integer instance to get its primitive value. Use FindClass instead of GetObjectClass (as in your code) to get a reference to the class java.lang.Integer and then GetMethodID and CallObjectMethod to actually invoke the intValue method.