Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LTE-CIVIL UnsatisfiedLinkError in Eclipse

I am trying to use LTE-CIVIL, I just got the libraries and added the no-swt.jar and the native win32 .jar's to my project in Eclipse and I'm getting this error. Any idea how to resolve this error. I'm only trying to run the example code that comes with the project.

Exception in thread "main" com.lti.civil.CaptureException:java.lang.UnsatisfiedLinkError: no civil in java.library.path at com.lti.civil.impl.jni.NativeCaptureSystemFactory.createCaptureSystem(NativeCaptureSystemFactory.java:24)at com.lti.civil.test.CaptureSystemTest.main(CaptureSystemTest.java:33)Caused by: java.lang.UnsatisfiedLinkError: no civil in java.library.path at java.lang.ClassLoader.loadLibrary(Unknown Source)at java.lang.Runtime.loadLibrary0(Unknown Source) at java.lang.System.loadLibrary(Unknown Source)at com.lti.civil.impl.jni.NativeCaptureSystemFactory.createCaptureSystem(NativeCaptureSystemFactory.java:21)
like image 597
khaannn Avatar asked Nov 20 '12 02:11

khaannn


1 Answers

This error use to come when your application is using any native library or dlls. To resolve the problem you have to add dll the java.library.path variable. Like if your Native dlls are presnet in C:/Work/lti-civil/native/win32-x86 then you have to add following code before using any civil class

    System.setProperty( "java.library.path", "C:/Work/lti-civil/native/win32-x86/" );
    Field fieldSysPath = ClassLoader.class.getDeclaredField( "sys_paths" );
    fieldSysPath.setAccessible( true );
    fieldSysPath.set( null, null );

it load your dlls into your application.

like image 157
Imrank Avatar answered Sep 27 '22 23:09

Imrank