fixed java codes.