问题
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:
- In the project properties dialog, go to Java Build Path > Libraries
- Expand the CPLEX 12.7 JAR node
- Select the subnode Native library location: (None) and click Edit...
来源:https://stackoverflow.com/questions/45453380/cplex-library-path-error-in-eclipse