Will FindClass succeed only if an instance of the class has previously
been instantiated?
No. It will find any class which your application's classloader knows about. Instantiated or not.
As long as only static methods are called and static class members are used, instance won't get created. Java is quite lazy in creating instances. Even the static initializer block is executed later than expected, see get static initialization block to run in a java without loading the class
When you read JNI documentation carefully, you will find out that CallStatic<type>Method
family takes jclass
as a parameter, whereas Call<type>Method
takes jobject
. I think this difference explains all.
On a bottom note: there is nothing like "throw-away instance" in Java. You probably think about C++ style, scoped instances created on stack. Java cannot be commanded to do that, everything is allocated dynamically on heap and scope is determined by refcounting and scheduling of garbage collection.