Originally posted by: SystemAdmin
Hi there!
We am currently trying to use the OPL Java interface within eclipse.
We tried in in Linux and there it works quite well by setting the LD_LIBRARY_PATH accordingly.
No we want to make it work on Windows, however, this does not seem so easy.
We included the oplall.jar as on Linux (and removed the cplex.jar).
The Windows PATH already contains the opl paths from the CPLEX Studio installation, so we first thought that should work, but it doesn't.
So we tried to add the PATH variable in the eclipse run configuration, but that neither helped.
We also tried to set a java.library.path as VM argument, but always the same error message:
Native code library failed to load: ensure the appropriate library (opl<VERSION>.dll/.so) is in your path.
Exception in thread "main" java.lang.ExceptionInInitializerError
at ilog.concert.cppimpl.concert_wrap.setDebugWrappers(concert_wrap.java:34)
at ilog.opl.IloOplFactory.setDebugMode(IloOplFactory.java:152)
at com.ibm.meso.utils.lp.OplSolver.run(OplSolver.java:56)
at com.ibm.meso.utils.lp.OplSolver.<init>(OplSolver.java:29)
at com.ibm.meso.utils.lp.OplTest.main(OplTest.java:50)
Caused by: java.lang.RuntimeException: Native code library failed to load: ensure the appropriate library (opl<VERSION>.dll/.so) is in your path.
at ilog.concert.IloJNILoader.loadJNI(IloJNILoader.java:79)
at ilog.concert.cppimpl.concert_wrapJNI.<clinit>(concert_wrapJNI.java:15)
... 5 more
To make sure that the system PATH is set correctly I compiled my java code from the console and ran it from the console, and both worked!
It seems that eclipse is not using the right PATH variable and not finding the dll's.
Does anybody know how to solve this problem or has any suggestions what else to try?
Thanks a lot for any help!
Best,
Stefan
P.S.: We tried on a Win XP and a Win 7. We tried with CPLEX 12.2, 12.3 and 12.4.
#DecisionOptimization#OPLusingCPLEXOptimizer