title: Get fully-qualified class name from jclass (JNI) for use in FindClass
body: <p>Let's assume we hav an instance of jclass:</p>
  
  <pre><code>auto objectClass = env-&gt;GetObjectClass(obj);
  EXCEPTION_RETURN(env);
  </code></pre>
  
  <p>On the next line, I want to get the name of the class and store that so I can use <code>FindClass</code> later on.</p>
  
  <p>I've tried using <code>getName()</code> method but that returns a java class name and we can't use that in the <code>FindClass</code>. Here is my code for the <code>getName()</code> approach:</p>
  
  <pre><code>std::string GetObjectClassName(JNIEnv* env, jobject javaObject)
  {
      auto javaClass = env-&gt;GetObjectClass(javaObject);
      EXCEPTION_RETURN(env);
  
      auto javaClassClass = env-&gt;FindClass("java/lang/Class");
      EXCEPTION_RETURN(env);
  
      auto javaClassNameMethod = env-&gt;GetMethodID(javaClassClass, "getName", "()Ljava/lang/String;");
      EXCEPTION_RETURN(env);
  
      auto javaClassNameJString = (jstring)env-&gt;CallObjectMethod(javaClass, javaClassNameMethod);
      EXCEPTION_RETURN(env);
  
      auto javaClassNameC = env-&gt;GetStringUTFChars(javaClassNameJString, 0);
      EXCEPTION_RETURN(env);
      std::string javaClassName(javaClassNameC);
  
      env-&gt;ReleaseStringUTFChars(javaClassNameJString, javaClassNameC);
      EXCEPTION_RETURN(env);
  
      return javaClassName;
  }
  </code></pre>
  
  <p>Notice that the returned class name can't be used in the <code>FindClass()</code> method. Is there a simple way for us to get the class name from <code>jclass</code> object?</p>