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

↘锁芯ラ 提交于 2019-11-30 09:05:31

问题


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


回答1:


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.



回答2:


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());


来源:https://stackoverflow.com/questions/11825528/exception-in-thread-main-java-lang-unsatisfiedlinkerror

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!