简体   繁体   中英

java.lang.UnsatisfiedLinkError: no so in java.library.path

When i'm trying to load the .so file from the Java, i'm getting error like this.

Exception in thread "main" java.lang.UnsatisfiedLinkError: no yeslib.so in java.library.path
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1681)
    at java.lang.Runtime.loadLibrary0(Runtime.java:840)
    at java.lang.System.loadLibrary(System.java:1047)
    at com.rct.micros.util.GetCustClass.getScratchCode(GetCustClass.java:76)
    at com.rct.micros.util.GetCustClass.main(GetCustClass.java:39)

I have tried System.load(absoulte path) and System.loadLibrary(sofilename). Both are giving the same error. When i copy this so file into usr/lib/jvm package, it is working..

can anyone help how to get this solved using Java. i'm running on linux box.

It's possible that the library is on your path, but it can't be loaded for some other reason.

A trick I've used to debug problems like this is to run java -Xrunsofilename

-Xrun is the JVM option to load JVMPI libraries (the old profiling interface). If it succeeds, it will load the library and complain that it's not an agent library. But if it fails (hopefully!) it will print an error message. This is usually a more descriptive error message than what you get from the UnsatisfiedLinkError.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM