Add Java support

Here is a patch that adds support for Java methods.