add Java version, working but untested