1

So I am working on this project and I need to use tess4J inorder to read some text on some images. Unfortunatly i can not seem to resolve the following error:

Error opening data file C:\Users\****\eclipse workspace\****\tessdata\eng.traineddata Please make sure the TESSDATA_PREFIX environment variable is set to your "tessdata" directory. Failed loading language 'eng' Tesseract couldn't load any languages!

The path for the tessdata folder is given using instance.setDatapath("C:\\Users\\****\\eclipse workspace\\****\\tessdata\\")

Where instance is ITesseract instance = new Tesseract();

Any help to resolve this issue is appreciated.

Thank you

1 Answers1

0

Make sure your eng.traineddata file is not corrupted and of the correct version. If it is for Tesseract 4.0, use either fast or best.

https://github.com/tesseract-ocr

nguyenq
  • 8,212
  • 1
  • 16
  • 16
  • so that did not work and the error stayed. I finally gave up and decided to download a whole project from github and work my way from there. After a bit of time the error went away but I am now presented with another error. `Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'libtesseract302': The specified module could not be found.` keep in mind this is even without modifying the project just loading it into eclipse. [link](https://github.com/yuta1984/tess4jtest) ` – mohammed mallah Feb 07 '19 at 08:51
  • small update, I found online that you should be running it on x32 jre (since the dlls are that wat) so I tried that but the error is still there – mohammed mallah Feb 07 '19 at 09:58