Working version with basic JNI call