Instead of hand rolling java bindings they should be auto generated by parsing the java source using something like https://github.com/c2nes/javalang