Added some build files for producing the java lib.
Moved the java files into src main java. Fixed a compile issue.  Ignored gradle generated dirs.
Fixed another compile error.