Fixed java build errors