Exception in thread “main” java.lang.UnsatisfiedLinkError"

后端 未结 2 1516
误落风尘
误落风尘 2020-12-19 19:15

This exception is arising when I am running my program for smart card reading. My device is not connected. Please help me.

相关标签:
2条回答
  • 2020-12-19 19:42

    This means it could not load a shared library you need. This could be because.

    • The library is not in your library path.
    • The library does not have the right name e.g. LIBRARY must be libLIBRARY.so on Unix
    • The library is not executable by you.
    • The library is not for the OS or bit size of your JVM. e.g. a 64-bit JVM will not load a 32-bit library.
    • Your JRE is not installed correctly and it is failing to load one of its own libraries.
    • You are using a shared library which needs another shared library you don't have.
    • The DLL wasn't build as a JNI library or used from JNA.
    0 讨论(0)
  • 2020-12-19 19:42

    I got this when using System.loadLibrary which will use the java.libary.path resource. Since absolute path isn't allowed by loadLibrary, you can use the absolute path and load method.

        System.load(HelloWorld.class.getResource("/dlls/HelloWorld.dll")
                .getPath());
    
    0 讨论(0)
提交回复
热议问题