Eclipse中的CPLEX库路径错误 [英] CPLEX library path error in eclipse

查看:108
本文介绍了Eclipse中的CPLEX库路径错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用eclipse进行Java编码

I'm using eclipse for java coding

我完成了代码,并在CPLEX库12.6上运行良好(我在属性>库中添加了库>添加外部jar> cplex.jar)

I completed the code and it worked well on CPLEX library 12.6(I added library in properties> libraries > add external jars > cplex.jar)

我想更改CPLEX 12.7的库,所以我删除了前一个库并添加了CPLEX 12.7的cplex.jar,但是突然我收到了错误消息.

I wanted to change the library of CPLEX 12.7, so I removed previous one and added cplex.jar of CPLEX 12.7, but suddenly I got error message.

它说如下;

java.lang.UnsatisfiedLinkError: no cplex1270 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=...
Exception in thread "main" java.lang.UnsatisfiedLinkError: 
ilog.cplex.Cplex.CPXopenCPLEX([I)J
    at ilog.cplex.Cplex.CPXopenCPLEX(Native Method)
    at ilog.cplex.CplexI.init(CplexI.java:6736)
    at ilog.cplex.CplexI.<init>(CplexI.java:746)
    at ilog.cplex.IloCplex.<init>(IloCplex.java:10303)
    at ilog.cplex.IloCplex.<init>(IloCplex.java:10318)
    at ColumnGen$MasterProblem.createModel(ColumnGen.java:222)
    at ColumnGen$MasterProblem.<init>(ColumnGen.java:196)
    at ColumnGen.<init>(ColumnGen.java:648)
    at main_BnP_MU.<clinit>(main_BnP_MU.java:8)

我该如何克服?

推荐答案

堆栈跟踪包含(本机方法):您可能错过了指定本机库的位置,即的位置.dll (Windows)或 .so (Linux)文件:

The stack trace contains (Native Method): probably you missed to specify the native library location, the location of the .dll (Windows) or .so (Linux) file:

  1. 在项目属性对话框中,转到 Java Build Path>库
  2. 扩展CPLEX 12.7 JAR节点
  3. 选择子节点本机库位置:(无),然后单击编辑...
  1. In the project properties dialog, go to Java Build Path > Libraries
  2. Expand the CPLEX 12.7 JAR node
  3. Select the subnode Native library location: (None) and click Edit...

这篇关于Eclipse中的CPLEX库路径错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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