2

Please let me know how to use Native Lib. in Eclipse.
for more:
I am using AspriseOCR.dll in our project for image processing.
but sys can't find this dll file in java library path.
i am getting below error:

Exception in thread "main" 
java.lang.UnsatisfiedLinkError: no AspriseOCR in java.library.path
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)
    at java.lang.Runtime.loadLibrary0(Runtime.java:823)
    at java.lang.System.loadLibrary(System.java:1030)
    at com.readimage.ReadIMG.main(ReadIMG.java:37)
Lukas Knuth
  • 25,449
  • 15
  • 83
  • 111
  • I got the same error, followed the steps mentioned in the below 1st answer, but did not solved my problem. Pls someone guide me on this.. – Srikanth Nakka Nov 03 '13 at 11:37

2 Answers2

2

I also had the same problem. It was resolved by putting below .dll into ../java(version)/jre/bin folder:

AspriseOCR.dll, AspriseJTwain.dll, DevIL.dll, ILU.dll

Vishal Srivastava

0

you have to add the dll path into your System path. you can use following code to add dll file into your system path

    System.setProperty( "java.library.path", "DriveName:/native/dll-folder/" );
    Field fieldSysPath = ClassLoader.class.getDeclaredField( "sys_paths" );
    fieldSysPath.setAccessible( true );
    fieldSysPath.set( null, null );
Imrank
  • 1,009
  • 5
  • 15
  • java.lang.NoSuchFieldException: AspriseOCR at java.lang.Class.getDeclaredField(Class.java:1882) at com.readimage.ReadIMG.main(ReadIMG.java:33) Exception in thread "main" java.lang.UnsatisfiedLinkError: no AspriseOCR in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682) at java.lang.Runtime.loadLibrary0(Runtime.java:823) at java.lang.System.loadLibrary(System.java:1030) at com.asprise.util.ocr.OCR.loadLibrary(OCR.java:247) at com.asprise.util.ocr.OCR.(OCR.java:56) at com.readimage.ReadIMG.main(ReadIMG.java:49) ----- getting this error. – Arvind Vishwakarma May 04 '13 at 11:17
  • I had same problem when i was working with OCR native lib. just put "AspriseOCR.dll" to your C:/programs files/java(version)/jre/bin folder.. and check.. i hope it'll work properly :-) – Arvind Vishwakarma Jul 16 '13 at 07:17