包括Tess4J到Java项目作为在Eclipse库 [英] Including Tess4J to a Java project as library in Eclipse
问题描述
我有一个至今空的,干净的Eclipse的Java项目。
我有什么做的,使用 Tess4J
作为库,我想发展我的web服务?
它甚至有可能将其用作图书馆的Android项目? (将shortcutting很多)的有关于的.tif
与Android,我碰到一个问题。
I have an so far empty and clean Eclipse Java project.
What do I have to do to use Tess4J
as library for my web service that I want to develop?
Is it even possible to use it as library for an Android project? (would be shortcutting a lot) There is an issue regarding .tif
with android that I came across.
Tess4J包装了原生code,因为的tesseract-OCR是用C / C ++。我已经走到这一步。但如何将这种包装到我的项目?
Tess4J is a wrapper for native code, because tesseract-ocr is written in C/C++. That I've got so far. But how to include this wrapper into my project?
我GOOGLE了很多,直到我已经决定放弃 tesseract.Net
,怎么一回事,因为这个项目是保养不善/记录,并会迫使我到C#(这将是没关系),但我没能得到它的工作,所以我不得不默认为C / C ++(这是不行的);)
I've googled a lot until I have decided to drop tesseract.Net
, beacuse this project is badly maintained/documented and would force me to C# (which would be okay), but I didn't manage to get it to work, so I had to default to C/C++ (which is not okay) ;)
我迷路了,现在,所以任何帮助是值得欢迎的。 问候。
I'm kind of lost right now, so any help is welcome. regards.
编辑:跟着提到的步骤这里(从nguyenq答案)
followed the steps mentioned here (answer from nguyenq)
1:新的Eclipse工作区
1: new Eclipse workspace
2:创建一个新的目录名为 LIB
2: created a new dir called lib
3:复制 \ Tess4J \ DIST \ tess4j.jar
, \ Tess4J \ lib目录\ jna.jar
和 \ Tess4J \ lib目录\ jai_imageio.jar
到 LIB
(2)
3: copied \Tess4J\dist\tess4j.jar
, \Tess4J\lib\jna.jar
and \Tess4J\lib\jai_imageio.jar
into lib
(2)
4:在Eclipse中创建了一个新的Java项目
4: created a new Java project in Eclipse
5:在项目属性(4)我加的.jar文件(3)到Java构建路径外部罐下的库
5: in project properties (4) I added the .jars from (3) to Java build path as external jars under libraries
6:我复制的目录 \ tessdata code>和
libtesseract302.dll
到项目的根目录 \工作区\项目\
6: I copied the dir \tessdata
and libtesseract302.dll
into the project root dir \workspace\project\
7:我创建了一个新的类主
和实例化一个 Tesseract1的tesseract =新Tesseract1();
测试
7: I created a new class Main
and instantiated a Tesseract1 tesseract = new Tesseract1();
for testing
8:我运行的应用程序,但引发了异常:在线程异常主要java.lang.UnsatisfiedLinkError中:无法加载库'libtesseract302模块找不到
8: I run the application but an Exception was thrown: Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'libtesseract302' Module not found
EDIT2:
7.1:我创建了一个新的类主
和实例化一个的tesseract的tesseract =新Tesseract.getInstance();
测试(来源:这里 )
7.1: I created a new class Main
and instantiated a Tesseract tesseract = new Tesseract.getInstance();
for testing (source: here)
8.1:看起来还好,到目前为止,但没有实现的逻辑,只是试图建立它
8.1: looked okay so far, but no logic implemented, just tried to build it.
EDIT3:
9:不,不工作。还有的UnsatisfiedLinkError。难道它可能是关于32位与64位的问题? 我'工作的Win7 64位。
9: nope, doesn't work. Still UnsatisfiedLinkError. Could it may be an issue regarding 32-bit vs. 64-bit? I'am working on Win7 64bit.
推荐答案
请按照下面的链接中描述的步骤获得Tess4J在Eclipse中运行:
Follow the steps described in the following link to get Tess4J to run in Eclipse:
<一个href="http://sourceforge.net/projects/tess4j/forums/forum/1202294/topic/4506433">http://sourceforge.net/projects/tess4j/forums/forum/1202294/topic/4506433
我不知道该库将运行在Android,因为它似乎在平台上JNA的支持还没有。
I'm not sure the library would run on Android because it seems JNA support on the platform is not there yet.
如果你想有一个.NET包装的tesseract 3.01,看看<一href="https://github.com/charlesw/tesseract-ocr-dotnet">https://github.com/charlesw/tesseract-ocr-dotnet.
If you want a .NET wrapper for Tesseract 3.01, take a look at https://github.com/charlesw/tesseract-ocr-dotnet.
这篇关于包括Tess4J到Java项目作为在Eclipse库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!