General purpose java routines.