Java exception- Exception in thread “main” java.lang.NoClassDefFoundError: net/sourceforge/tess4 j/Tesseract

拟墨画扇 提交于 2019-12-05 20:49:33

Your jar file manifest should include a Class-Path entry:

Class-Path: tess4j.jar jai_imageio.jar

Those jar files should then be placed in the same directory as your jar file at execution time, so they can be loaded appropriately.

At that point, all should be well. But without that entry in the manifest, there's nothing to connect your jar file with the other jar files it depends on.

you are packaging the file the wrong way, your dependencies are not in the jar

where is your Class ? You have missed to write class . Inside class there would be public static void main(String args[]) and to compile Tesseract instance = Tesseract.getInstance();

you will need tess4j.jar in build path.

songgeb

If your OS is Windows, libtesseract304.dll (used to OCR) is built with VC2013, so you need other system dll. Download here.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!