Improvement of javadoc

A large number of thrown exceptions are now documented. Moreover, a few JNI calls were missing a `try`/`catch` block.

@bmunkholm @emanuelez