9910

          單飛

             :: 首頁 :: 聯(lián)系 :: 聚合  :: 管理

          System.loadLibary()

          The parameter to System.loadLibrary() should be the name of the libary, without path, extension or "lib":

          1: System.loadLibrary("payment");

          Depending on your platform, this will load libpayment.so or payment.dll.

          Although it is not an error to call System.loadLibrary() multiple times, loading the libraries is often done in a static code block:

          1: class Test {
          2: static {
          3: System.loadLibrary("payment");
          4: }
          5: }

          java.library.path



          Java searches several directories for this libary file. The directories to search are specified in the property java.library.path. On Linux, this is a copy of the environment variable LD_LIBRARY_PATH. On Windows, it is a copy of the PATH variable.

          Although changing the java.library.path has influence on how Java loads its libraries, it has no effect on Windows. When your library depends on other DLLs, these are loaded without taking java.library.path into account. If the library you load needs another library, which can not be found, you get an UnsatisfiedLinkError with the message "". To solve this, you can load the dependant libraries yourself using multiple calls to System.loadLibrary(), loading all libaries one by one.


          就是說假如你要加載的Dll依賴其它dll那你就要自己手工加載在Windows平臺。



          只有注冊用戶登錄后才能發(fā)表評論。


          網(wǎng)站導航:
           
          主站蜘蛛池模板: 海安县| 县级市| 沽源县| 开平市| 宁城县| 钟祥市| 阳曲县| 安仁县| 洛扎县| 柳林县| 宁城县| 宜丰县| 铜鼓县| 临沭县| 黄梅县| 兴安县| 尉氏县| 宝山区| 尚义县| 彩票| 南部县| 双桥区| 永吉县| 邯郸市| 临武县| 阳泉市| 武定县| 利辛县| 楚雄市| 鄂托克旗| 安康市| 明水县| 灵台县| 咸阳市| 芮城县| 北海市| 安岳县| 康定县| 香格里拉县| 巢湖市| 衡阳县|