title: JNI setting Static Field String Array
body: <p>I am trying to set a String Array field in my class but am running into all sorts of problems.  This is what i have so far:</p>
  
  <pre><code>JNIEXPORT jint JNICALL Java__Names1_GetMyNames(JNIEnv *env, jobject obj)
  {
  jfieldID myNamesID; /* store the field ID */
  int i=0;
  jstring myStr;
  jobject dev;
  char* myNames[] = {"Hello ", "world!"};
  
  // Get a reference to obj’s class 
  jclass cls = env-&gt;GetObjectClass(obj);
  // Get static field ID
  myNamesID = env-&gt;GetStaticFieldID(cls, "myDevNames", "[Ljava/lang/String;");
  // Get the object field
  dev = env-&gt;GetObjectField(obj,myNamesID);
  
  for (i=0; i&lt;2; i++) {
  myStr = env-&gt;NewStringUTF(myNames[i]);
  env-&gt;SetObjectArrayElement(dev,i,myStr);
  }
  return 0;
  }
  </code></pre>
  
  <p>and this is my string:</p>
  
  <pre><code>private static String[] myDevNames= new String[12];
  </code></pre>
  
  <p>When i try to compile i get the following error:</p>
  
  <p>error: invalid conversion from 'jobject {aka _jobject*}' to 'jobjectArray {aka _jobjectArray*}' [-fpermissive]</p>
  
  <p>Any ideas what i am doing wrong?  Any help would be appreciated.</p>