title: calling exception.printStackTrace() from JNI
body: <p>The problem is to find out which Java functions call some JNI function. In Java, this would be achieved with <code>new Exception.printStackTrace()</code>, but this must be done from a native (JNI) function.</p>
  
  <p>Since the easiest way to find your own code later is to publish it in the 'net, I post both the question and the answer.</p>