UnsatisfiedLinkError, despite setting Djava.library.path variable

孤街醉人 提交于 2019-12-20 04:19:46

问题


I am trying to integrate IBM's CPLEX library with my java application. For now, i'm just trying to create an IloCplex object. I added Cplex.jar, and it compiles fine, but when I run this:

public class cplexTest{
    public static void main(String[] args){
        try{
            IloCplex cplex = new IloCplex();
        }catch (Exception e){
            e.printStackTrace();
        }
}

Cplex prints this message before throwing an exception:

java.lang.UnsatisfiedLinkError: no cplex124 in java.library.path  
java.library.path must point to the directory containing the CPLEX shared library  
try invoking java with java -Djava.library.path=...

I pass this argument to the JVM: -Djava.library.path="C:\Program Files\IBM\ILOG\CPLEX_Studio124\cplex\bin\x64_win64. This is the location of cplex124.dll. Every tutorial i've seen gives the same steps, and i feel like i followed them pretty well.

What am I doing wrong??


回答1:


What I've found in the interwebs is that one possible cause for this problem is the dll being in 32 or 64 bits and your java being in the opposite architecture.

Try verifying that your java and cplex.dll match.



来源:https://stackoverflow.com/questions/23482281/unsatisfiedlinkerror-despite-setting-djava-library-path-variable

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