MCJavaStringToNative converts a Java string object to a c-string... Here you are passing in a strdup() to an out parameter won't work (it needs to be a char* variable). To make this easier, I suggest adding (alongside MCJavaStringToNative) the method:
```
bool MCJavaStringToStringRef(JNIEnv *env, jstring p_java_string, MCStringRef& r_stringref);
```
You can then use that here to convert the java string to the stringref.