Static initializer and caching for classes and methods in JNI.