Update Java API.
fix example.