title: c JNI call java function
body: <p>My first function code in c jni is</p>
  
  <pre><code>void fun1()
  {
     jmethodID java_fun = (*global_env)-&gt;GetMethodID(global_env,cls_Env, "test1", "()V");
     (*global_env)-&gt;CallVoidMethod(global_env,(*global_obj), java_fun);
  }
  </code></pre>
  
  <p>And my second is</p>
  
  <pre><code>void fun2(int x)
  {
     jmethodID java_fun = (*global_env)-&gt;GetMethodID(global_env,cls_Env, "test2", "([I)V");
     (*global_env)-&gt;CallVoidMethod(global_env,(*global_obj), java_fun,(int)x);
  }
  </code></pre>
  
  <p>In my java side the code for first c function is</p>
  
  <pre><code>private void test1()
  {
      System.out.printf("test1");
      callfunction();
  }
  void callfunction()
  {
     System.out.printf("how i can get here??");
  
  }
  </code></pre>
  
  <p>The first question is how can i get to callfunction() from C call?</p>
  
  <p>Now the second java code for second c function is</p>
  
  <pre><code>public int var1;
  private void test2(int x)
  {
      System.out.printf("test2");
      var1=x;
  }
  </code></pre>
  
  <p>The second question is how can i save my data from c side in java side?</p>
  
  <p>Thanks</p>