Jinterface code cleanup

This fixes all the compilation warnings in the Java code. 

There are several commits that address (mostly) one kind of warning each.

This makes PR #202 obsolete.
They probably should, but here I wanted to keep changes minimal. I will go through all the code and look for more things to clean up, like the one you pointed out.