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.