For an ink jet printer, a maintenance unit having a simple mechanism that ensures a stable well-closed condition is provided. According to the present invention, rigid contact portions are provided in order to maintain a distance between an ink jet head and a cap in the perpendicular direction when the ink jet head is attached to the cap.