update java sample code to use latest java-client
Merge pull request #2490 from Jonahss/update

update java sample code to use latest java-client