Originally posted by: testuser11222
hi Guys,
I am trying to execute few jobs on CPLE using java however facing issue while running the code.
Following is the details.
Code
import ilog.concert.IloException;
import ilog.opl.IloCplex;
import org.junit.Test;
public class TestCplex {
@Test
public void testCPLX(){
try {
IloCplex cplex = new IloCplex();
} catch (IloException e) {
e.printStackTrace();
}
}
}
POM.xml
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.21.0</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit4</artifactId>
<version>2.21.0</version>
</dependency>
</dependencies>
<configuration>
<forkMode>once</forkMode>
<argLine>-Djava.library.path=/Applications/CPLEX_Studio_Community128/opl/bin/x86-64_osx/:/Applications/CPLEX_Studio_Community128/opl/oplide/:/Applications/CPLEX_Studio_Community128/cplex/bin/x86-64_osx/:/Applications/CPLEX_Studio_Community128/opl/lib/oplall.jar</argLine>
</configuration>
</plugin>
Error:
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.163 s <<< FAILURE! - in test.java.cplexTests.TestCplex
[ERROR] testCPLX(test.java.cplexTests.TestCplex) Time elapsed: 0.092 s <<< ERROR!
java.lang.UnsatisfiedLinkError: ilog.concert.cppimpl.concert_wrapJNI.swig_module_init()V
at test.java.cplexTests.TestCplex.testCPLX(TestCplex.java:13)
[INFO]
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR] TestCplex.testCPLX:13 » UnsatisfiedLink ilog.concert.cppimpl.concert_wrapJNI.s...
Following is the environment variable value.
Both LD_LIBRARY_PATH and LYLD_LIBRARY_PATH contains following value
/Applications/CPLEX_Studio_Community128/cplex/bin/x86-64_osx/:/Applications/CPLEX_Studio_Community128/opl/bin/x86-64_osx/
#CPLEXOptimizers#DecisionOptimization