A convenient D wrapper around JNI.