Reintroduce the java dependency commit

Done by Kiyoshi, but don't don't known why haven't enter 2.1 branch