CPLEX library path error in eclipse

吃可爱长大的小学妹 提交于 2021-01-27 19:45:33

问题


I'm using eclipse for java coding

I completed the code and it worked well on CPLEX library 12.6(I added library in properties> libraries > add external jars > 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.

It says as below;

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)

How can I overcome this?


回答1:


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


来源:https://stackoverflow.com/questions/45453380/cplex-library-path-error-in-eclipse

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