6 Java_martin_myNative(JNIEnv
* env
, jobject
this, jstring s
)
16 cls
= (*env
)->FindClass(env
, "java/lang/System");
18 printf("java/lang/System lookup failed\n");
21 fid
= (*env
)->GetStaticFieldID(env
, cls
, "out", "Ljava/io/PrintStream;");
23 printf("java/lang/System::out lookup failed\n");
26 obj
= (*env
)->GetStaticObjectField(env
, cls
, fid
);
28 printf("GetStaticObjectField call failed\n");
31 cls
= (*env
)->GetObjectClass(env
, obj
);
33 printf("GetObjectClass(out) failed\n");
36 mid
= (*env
)->GetMethodID(env
, cls
, "println", "(Ljava/lang/String;)V");
38 printf("println method lookup failed\n");
41 (*env
)->CallVoidMethod(env
, obj
, mid
, s
);