不满足LinkError,尽管设置了Djava.library.path变量 [英] UnsatisfiedLinkError, despite setting Djava.library.path variable

查看:643
本文介绍了不满足LinkError,尽管设置了Djava.library.path变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将IBM的CPLEX库与我的java应用程序集成。现在,我只是想创建一个IloCplex对象。我添加了Cplex.jar,它编译得很好,但是当我运行这个时:

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在抛出异常之前打印此消息: p>

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=...



我将这个参数传递给JVM: -Djava.library.path =C:\Program Files\IBM\ILOG\CPLEX_Studio124\cplex\bin\x64_win64 这是cplex124.dll的位置,我看过的每个教程都有相同的步骤,我觉得我跟着他们很好。

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.

我做错了什么?

推荐答案

我在interwebs中发现的一个可能的原因是这个问题是dll在32或64位,你的java在相反的架构。

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.

尝试验证你的java和cplex .dll匹配。

Try verifying that your java and cplex.dll match.

这篇关于不满足LinkError,尽管设置了Djava.library.path变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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