我正在尝试使用LTE-CIVIL,我刚刚获得了库,并将no-swt.jar和本机Eclipse.jar添加到我在win32中的项目中,我得到了这个错误。有没有办法解决这个错误。我只想运行项目附带的示例代码。
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)发布于 2013-02-07 16:43:06
当您的应用程序正在使用任何本机库或dll时,会出现此错误。为了解决这个问题,你必须在dll中添加java.library.path变量。例如,如果您的Native dll预先设置在C:/Work/lti- civil /native/win32-x86中,那么在使用任何civil类之前,您必须添加以下代码
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 );它会将您dlls加载到您的应用程序中。
https://stackoverflow.com/questions/13465839
复制相似问题