fix java runtime error