Add support for java

Will complete #2.