Update java code to latest version