title: convert c++ map to jobject JNI?
body: <p>I want to transfer a C++ map to Java and have no idea how to define the return parameter so the method works. I had no trouble with string or int as return parameters, but i can´t get map working.<br>
  My Java method looks like this:   </p>
  
  <pre><code>private native Map&lt;String,String&gt; sayHello();
  </code></pre>
  
  <p>My C++ Code is:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include "stdafx.h"
  #include "jni.h"
  #include "HelloJNI.h"
  #include &lt;utility&gt;
  #include &lt;map&gt;
  #include &lt;string.h&gt;
  #include &lt;iostream&gt;
  
  using namespace std;
  
  JNIEXPORT jobject JNICALL Java_HelloJNI_sayHello
  (JNIEnv *, jobject)
  {
      map&lt;string, string&gt; mMap;
      mMap["1"] = "Ladi";
      mMap["2"] = "Dida";
      return mMap;
  }
  </code></pre>
  
  <p>And of course i get an error, telling me i have to convert mMap to jobject somehow. But i have no idea how to do this.</p>
  
  <p>I hope its no double-post, i just found some questions dealing with transmitting lists.</p>
  
  <p>Thanks in advance.</p>