Are native Java methods equivalent to static Java methods?

java, java-native-interface

Solution

Native methods can be `static` or non-`static`, just like regular Java methods.

Non-`static` native methods receive `this` reference, `static` ones receive a reference to containg class instead.

From JNI Specification:

Native Method Arguments

The JNI interface pointer is the first argument to native methods. The JNI interface pointer is of type JNIEnv. The second argument differs depending on whether the native method is static or nonstatic. The second argument to a nonstatic native method is a reference to the object. The second argument to a static native method is a reference to its Java class.

Problem

I am rewriting some native methods as regular Java methods. Are native methods effectively static? Or is there ever a case where they have an implicit 'this' parameter? Thanks!

Original source