Fixed issues to make the java example a working example