pexmar
pexmar

Reputation: 341

Missing slf4j in tess4j

I want to test tess4j to do OCR. I used the following tutorial for a first example: http://tess4j.sourceforge.net/codesample.html I included the required libraries, but I am getting the following error:

Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
    at net.sourceforge.tess4j.Tesseract.<clinit>(Unknown Source)
    at tess4jexample.TesseractExample.main(TesseractExample.java:10)
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 2 more

Does anyone knows a solution for this?

Upvotes: 2

Views: 3173

Answers (2)

pexmar
pexmar

Reputation: 341

There has where still some dependencies missing, which have not been mentioned on the mavenrepository:

  • logback-core-1.1.6.jar
  • slf4j-api-1.7.21.jar

I think now it is working :-) Thank you nguyenq for this hint, to check the dependencies.

Upvotes: 1

nguyenq
nguyenq

Reputation: 8345

Tess4J has several dependencies. You'll need to include them in the classpath.

Upvotes: 2

Related Questions