tess4j: Failed loading language Tesseract couldn't load any languages!

Tess4J version - 3.1.0 Tesseract version - Tesseract Open Source OCR Engine v3.04.01 with Leptonica Os - OSX 10.11.3 El Capitan

//TESS4J_FOLDER_PATH = "/usr/local/Cellar/tesseract/3.04.01_1/share/' - location lang .traineddata
instance = new Tesseract();
instance.setDatapath(TESS4J_FOLDER_PATH);
instance.setLanguage("chi_tra");

String result = "";
File imageFile = new File(filePath);
try {
     result = instance.doOCR(imageFile);
} catch (TesseractException e) {
    System.err.println(e.getMessage());
}
return result;

i got error

Failed loading language 'chi_tra'
Tesseract couldn't load any languages!
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x000000012408d311, pid=68062, tid=0x0000000000001703
#
# JRE version: Java(TM) SE Runtime Environment (8.0_92-b14) (build 1.8.0_92-b14)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.92-b14 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# C  [libtesseract.dylib+0x13311]  _ZN9tesseract9Tesseract15recog_all_wordsEP8PAGE_RESP10ETEXT_DESCPK4TBOXPKci+0xb9
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Comments: 35 (9 by maintainers)

Most upvoted comments

@lokesh-stack I had similar problem too. I resolved it by downloading the raw tessdata.

https://github.com/tesseract-ocr/tessdata/blob/master/eng.traineddata?raw=true

can some one help me with following error:

lokesh@Biu:~$ tesseract /home/lokesh/Desktop/tess_imgs/1.tif ~/Desktop/out -l foo Failed loading language ‘foo’ Tesseract couldn’t load any languages! Could not initialize tesseract.

  1. Re-download traineddata from https://github.com/tesseract-ocr/tessdata didn’t help
  2. Checked again it fails with all large traineddata files, more ~20mb
  3. It works from console if i simply run tesseract imagefile output -l chi_tra
  4. And it works on windows machine Any suggestions ?

Make sure the environment variable TESSDATA_PREFIX is set to your tessdata directory! (for ex. C:\msys64\mingw32\share\tessdata).

Did anyone try out with changing locale, as suggested in Tesseract issue?

export LC_ALL=C