2

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?

안규리
  • 65
  • 1
  • 5

1 Answers1

2

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...
howlger
  • 31,050
  • 11
  • 59
  • 99
  • 1
    You have to enter the location of the native library (Windows: *.dll, Linux: *.so file) – howlger Aug 02 '17 at 07:57
  • 1
    For Windows, I entered `C:\Program Files\IBM\ILOG\CPLEX_Studio128\cplex\bin\x64_win64` and it worked. – Chris Jan 30 '19 at 16:51