_JAVA_OPTIONS – special JVM environment variable that we tend to forget about

If you experience really strange behaviour of your Java app, and you want to play with settings try using _JAVA_OPTIONS

setenv _JAVA_OPTIONS "-Xmx2G -Xms1G -Xcheck:jni"

You can set any settings as you would while calling java.

If you are looking for more JNI samples take a look here: http://jnicookbook.owsiak.org