Menu

how to set up Tess4j in Netbeans ?

Help
cmr
2014-05-09
2015-01-08
  • cmr

    cmr - 2014-05-09

    I've read forums where it said "Tess4j is a Netbeans project so just run the test and it should work" but it doesn't.

    Unable to load library 'libtesseract302': Native library (win32-x86/libtesseract302.dll)

    I keep getting this error. I tried switching to 32 bit JVM in Netbeans but setting the following
    netbeans_jdkhome="C:\Program Files (x86)\Java\jdk1.8.0_05\"
    In netbeans.conf file
    but I still get the error.

    I also tried replacing the ddl files with https://github.com/charlesw/tesseract/tree/master/src/lib/TesseractOcr/x64
    But I still keep getting the error.

    Who uses 32 bit these days anyway!!

    Can someone PLEASE tell me step by step on how to setup Tess4j in Netbeans 8 on a Windows 8 64 bit machine ?

     
  • Quan Nguyen

    Quan Nguyen - 2014-05-09

    The Tess4J-2.0-Beta-src.zip file under Files section or in svn repository has everything you need. If you're running JVM 64-bit, copy the 64-bit DLLs from lib\win32-x86-64 to the project root directory. Open the project in NB, expand the Test Packages and run the unit tests.

     

    Last edit: Quan Nguyen 2014-05-09
  • cmr

    cmr - 2014-05-10

    Thanks for replying Quan. It is still not working. I copied the DLLs to test root directory that stopped the unable to load library 'libtesseract302' error but now I'm getting

    Testcase: testOSD(net.sourceforge.tess4j.TessAPITest):  Caused     an ERROR
    The specified module could not be found.
    
    java.lang.UnsatisfiedLinkError: The specified module could not be found.
    
    at com.sun.jna.Native.open(Native Method)
    at com.sun.jna.Native.open(Native.java:1759)
    at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:260)
    at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:398)
    at com.sun.jna.Library$Handler.<init>(Library.java:147)
    at com.sun.jna.Native.loadLibrary(Native.java:412)
    at com.sun.jna.Native.loadLibrary(Native.java:391)
    at net.sourceforge.tess4j.TessAPI.<clinit>(TessAPI.java:39)
    at net.sourceforge.tess4j.TessAPITest$TessDllAPIImpl.getInstance(TessAPITest.java:667)
    at net.sourceforge.tess4j.TessAPITest.setUp(TessAPITest.java:58)
    

    I've attached screenshots of both the errors. Please have a look for me.

    Thank you so much.

     

    Last edit: cmr 2014-05-10
  • cmr

    cmr - 2014-05-10

    I tried running the test with Netbeans and with the build.xml file

    run target -> compile
    

    and then

    run target -> test
    
     
  • Quan Nguyen

    Quan Nguyen - 2014-05-10

    Copy DLLs to Tess4J folder, not test, as you did in screen1.png.

    Right click on one of the four test files and select Test File. Or open any of them, place the cursor on a test case (method) of your interest, and select Run Focused Test Method.

    If you still encounter Unable to load library 'libtesseract302' error, try set NetBeans project's VM Options: -Djna.library.path="C:\Your Directory of DLLs"

     

    Last edit: Quan Nguyen 2014-07-24
  • Desalegn

    Desalegn - 2015-01-08

    Hello Dears. How are you? Currently I am trying to do java code for ocr support. But I am getting problem with down loading java source code of Tess4j. I want to use it in my educational project.I am using netbeans IDE. Please send me the source code of Tess4j through my email. my email is desu.terefe@gmail.com

     

Log in to post a comment.