Google 'java OCR api' and also see the following:
format - Java based OCR SDK/API - Stack Overflow
I have not used the packages in that link myself, but can guess that they vary in accuracy so I would try as many as you can with a training and test set to evaluate how they each perform (each algorithm is going to very in accuracy). I would also recommend perhaps using different feature extraction techniques and test for accuracy. FWIW I have written low level OCR tools and they are not trivial - often rely in a complex machine learning algorithm (neural network, PCA, etc..) that require lots of training and testing to even come close to reproducible and accurate results.