Calling static methods from native methods is similar to calling instance methods. There are two differences:
• Use the
• Supply a class object, not an implicit parameter object, when invoking the method
As an example of this, let’s make the call to the static method
from a native method. The return value of this call is a string that gives the current class path.
First, we have to find the class to use. As we have no object of the class
System readily available, we use
FindClass rather than
jclass class_System = (*env)->FindClass(env, "java/lang/System");
Next, we need the ID of the static
getProperty method. The encoded ...