[java] Java OCR implementation