I'm trying to run a file.java and file.class for which I need to use a library of Cplex (optimization problem) using
$ javac -cp /home/apps/cplex/12.6.1/cplex/lib/cplex.jar file.java
$ java -cp /home/apps/cplex/12.6.1/cplex/lib/cplex.jar:. file
which was recommended when I asked in Compile Cplex in Java in linux . I finally ended the correction of my file (thing that worked in windows didn't in Linux) and the first line worked, but in the second one I got this error...
java.lang.UnsatisfiedLinkError: no cplex1261 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:6608)
at ilog.cplex.CplexI.<init>(CplexI.java:629)
at ilog.cplex.IloCplex.<init>(IloCplex.java:10194)
at ilog.cplex.IloCplex.<init>(IloCplex.java:10209)
at memoria.bosques.problemafull(bosques.java:11395)
at memoria.bosques.main2(bosques.java:17829)
at memoria.bosques.main(bosques.java:18014)
I tried replacing java -Djava.library.path=/home/apps/cplex/12.6.1/cplex/lib/cplex.jar instead of -cp /home/apps/cplex/12.6.1/cplex/lib/cplex.jar but didn't work either. The error occur in the fist time I define something of Cplex(before this was running fine)
IloCplex cplex = new IloCplex();
what can I do to solve my problem?