Reputation: 307
I have been trying, unsuccessfull so far, to get Tess4J to work on NetBeans. I am following the tutorial here:- http://tess4j.sourceforge.net/tutorial/
I have followed it word for word, but get this error message saying:-
"Error opening data file ./tessdata/eng.traineddata Please make sure the TESSDATA_PREFIX environment variable is set to the parent directory of your "tessdata" directory. Failed loading language 'eng' Tesseract couldn't load any languages!"
Can someone tell me what this means please, and how to rectify it?
I have a screenshot here of the project in NetBeans:-
Upvotes: 0
Views: 1288
Reputation: 11
ITesseract instance = new Tesseract();
instance.setDatapath("C:\Users\Tux\Documents\tessdata");
this worked for me.you can put the language file in the 'tessdata' folder. you can create the 'tessdata' folder anywhere
Upvotes: 0
Reputation: 36
Set Data Full Path like below:
process.setDatapath("F:/Jar/Tess4J-3.4.8-src/Tess4J/tessdata");
Or put the tessdata files in project root directory. It should be work fine.
Upvotes: 1
Reputation: 6307
The additional required files are missing from your environment variables.
We can see on the instruction page you linked:
Since the DLLs are built using Visual Studio 2015/2017, please ensure you have Visual C++ 2015 Redistributable or VC++ 2017 Redistributable installed.
The fastest way to fix your issues is to make sure you have VC++ 2017 Redistributable installed.
Alternately you could get the required files elsewhere and manually add them to your project location or elsewhere in your classpath.
Edit: If you are not on a windows machine, or simply want to build the library fully, then see here: https://github.com/tesseract-ocr/tesseract/wiki/Compiling
Upvotes: 0