java - running from console is ok, from Eclipse error -
i'm going crazzy eclipse. writing simple test class uses external jar. uses native library .dll when running eclipse, command run. here stack trace:
exception in thread "main" java.lang.unsatisfiedlinkerror: c:\program files\yaz\bin\yaz4j.dll: specified procedure not found @ java.lang.classloader$nativelibrary.load(native method) @ java.lang.classloader.loadlibrary1(classloader.java:1939) @ java.lang.classloader.loadlibrary0(classloader.java:1864) @ java.lang.classloader.loadlibrary(classloader.java:1854) @ java.lang.runtime.loadlibrary0(runtime.java:845) @ java.lang.system.loadlibrary(system.java:1084) @ org.yaz4j.connection.<clinit>(connection.java:56) @ ru.test.testconnection(test.java:20) @ ru.test.main(test.java:15)
but when run code console this
java -cp "bin;c:\program files\yaz\java\yaz4j.jar" ru.test
everything works perfect! it's same code. how works in console , not works in eclipse?
here how plugin referenced jar project in eclipse:
the messages when native methods fail link dreadful. can think of several root causes might give message:
- the dll isn't loading other dependent dll when loaded eclipse. governed windows path environment variable, different when you're running in eclipse.
- it's 32-bit dll, , you're running 64-bit jvm under eclipse, 32-bit command line (or vice versa.)
Comments
Post a Comment