java.lang.UnsatisfiedLinkError即使在设置-Djava.library.path [英] java.lang.UnsatisfiedLinkError even on setting -Djava.library.path

查看:233
本文介绍了java.lang.UnsatisfiedLinkError即使在设置-Djava.library.path的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在加载一个库到我的java代码。
我把这个库放在sytem 32文件夹里,我也设置了-Djava.library.path。



早期这段代码正在运行

  try {


System.loadLibrary(resources / TecJNI);

System.out.println(JNI库loaded \\\
);
}
catch(UnsatisfiedLinkError e){
System.out.println(未加载库);
e.printStackTrace();
}

但自上周以来,它正在显示

  java.lang.UnsatisfiedLinkError:java.library.path中没有资源/ TecJNI。 

这是一些文件权限问题,我正在加载的java代码或dll正在使用通过其他一些应用程序。



还有我正在使用&



有没有人可以建议我?



编辑:我正在使用 -


Djava.library.path =$ {workspace_loc} /org.syntec.ivb.application/resources; $ {env_var :PATH}


在我的eclipse vm参数。我想它正在使用这个。

解决方案

System.loadLibrary需要库名称,而不是路径。包含库的目录的路径应在PATH(Windows)env变量或-Djava.library.path中设置


I am loading a library into my java code. I have put the library in the sytem 32 folder and I have also set the -Djava.library.path.

Earlier this code was running

try{


        System.loadLibrary("resources/TecJNI");

        System.out.println("JNI library loaded \n");
    }
    catch(UnsatisfiedLinkError e){
        System.out.println("Did not load library");
        e.printStackTrace();
    }

but since last week it is showing

java.lang.UnsatisfiedLinkError: no resources/TecJNI in java.library.path.

Is this some file permission issue for the dll that I am loading in the java code OR dll are using by some other application.

Also all other my running applications that were using & loading the same dll in different workspace are not running now.

Could anyone suggest me?

EDIT: I am using -

Djava.library.path="${workspace_loc}/org.syntec.ivb.application/resources;${env_var:PATH}"

in my eclipse vm arguments. I think it is using this.

解决方案

System.loadLibrary expects library name, not a path. The path to the directory containg the library should be set in PATH (Windows) env variable or in -Djava.library.path

这篇关于java.lang.UnsatisfiedLinkError即使在设置-Djava.library.path的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆