Rewrite client by Java.