kete nefrega
kete nefrega

Reputation: 221

Tessj4 - Error opening data file ./tessdata/eng.traineddata

I have this problem in my web application in Tomcat 9:

Error opening data file ./tessdata/eng.traineddata Please make sure the TESSDATAPREFIX environment variable is set to the parent directory of your "tessdata" directory. Failed loading language 'eng' Tesseract couldn't load any languages!

I create folder C:\Tess4J from Tess4J 3.0.4 zip, with subfolders:

In catalina.properties i add:

In environments i try to add both, and doesn't work:

Then i invoke my servlet whit doOCR method, and i've got error.

May you help me please?

Upvotes: 8

Views: 14040

Answers (1)

Genarito
Genarito

Reputation: 3463

You have to choose the up directory, in your case C:\Tess4J, try it:

tessInst= new Tesseract();
tessInst.setDatapath("C:\\Tess4J"); 
tessInst.setLanguage("eng");

Sorry about my english

Upvotes: 15

Related Questions