update C++ version and add Java version