简体   繁体   中英

Using Tess4J on Tomcat

When I use the Tess4J library I get an error:

java.lang.NoClassDefFoundError: Could not initialize class net.sourceforge.tess4j.TessAPI

at runtime.

But I don't get the meaning of this error, nor I am able to resolve it.

My problem is that 2 native dlls have to be loaded by Tess4J but this is out of my hands. I've added the location of the dlls to the build path for each jar.

I noticed, that when I first trigger Tess4J with my client, I get an error:

java.lang.UnsatisfiedLinkError: Unable to load library 'libtesseract302'

but every consecutive call results in the NoClassDefFoundError exception.

In my case switching from 64-bit Java to 32-bit Java solved the java.lang.UnsatisfiedLinkError: Unable to load library 'libtesseract302' problem (Tesseract is a 32-bit app) . Don't forget to put libtesseract302.dll , liblept168.dll and tessdata in jdk/bin folder .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM