In Java applications
IBM ILOG CPLEX Optimization Studio needs to locate Java and ICU shared libraries on Windows and UNIX platforms.
The Java API for OPL is provided as the oplall.jar file, located in the
opl\lib directory of IBM ILOG CPLEX Optimization Studio. At run time, this .jar
file references other OPL shared libraries, which may also depend on other libraries. All OPL shared
libraries are, by default, located in a subfolder of the opl\bin directory of
IBM ILOG CPLEX Optimization Studio. For example, opl\bin\x64_win64 for the Windows 64-bit port.
For Java applications to correctly invoke OPL objects, the operating system needs to load these libraries, as well as other dependent libraries. This is done essentially in the same way for Windows and UNIX machines.
oplall.jar file that corresponds
to your platform. This oplall.jar file is delivered
with the installer for a given platform and is specific to that platform.For IBM ILOG CPLEX Optimization Studio on Windows
IBM ILOG CPLEX Optimization Studio needs to find one .dll file
for OPL: opl<version>.dll. The PATH environment
variable must include the directory containing this shared library.
By default, it is located in the opl\bin\<port> directory
of the distribution.
At run time, this opl<version>.dll file
references other OPL .dll files, which may also depend
on other .dll files.
When CPLEX Optimization Studio is installed, the Microsoft Visual C++ 2015 (or 2017/2019) Redistributable Package (x64) must also be installed. This package installs runtime components of Visual C++ Libraries required to run applications developed with Visual C++ 2013 (or 2017/2019) on a computer that does not have Visual C++ installed. If the installer detects that this package is not already installed, it explains what you need to do.
There are dependencies on DLLs in this redistributable package, and you should bear this in mind if you package shared libraries to be deployed on a machine where IBM ILOG CPLEX Optimization Studio is not installed.
For IBM ILOG CPLEX Optimization Studio on UNIX platforms
IBM ILOG CPLEX Optimization Studio needs to find the libopl<version> and the libcplex<version> shared libraries.
IBM ILOG CPLEX Optimization Studio also needs to find the ICU libraries libicu*.so.
ICU (International Components for Unicode) is a set of C/C++ and Java
libraries that provide Unicode and Globalization support for CPLEX
Optimization Studio. ICU is widely portable and gives applications
the same results on all platforms and between C/C++ and Java software.
These libraries are located, by default, in the opl/bin directory of CPLEX
Studio. The PATH environment variable for shared libraries must contain a reference
to the directory holding these libraries.
In general, for programs
that use the Java interface to OPL to run correctly, the oplall.jar file
must be in the Java classpath, and the necessary shared libraries
in the dynamic library path. Moreover, you must make sure that the PATH environment
variable for dynamic libraries does not reference directories from
other IBM ILOG CPLEX Optimization Studio installations; this avoids versioning problems.
As
an alternative solution, you can package all the necessary shared
libraries directly with your application, in the same directory as
the application executable. Many operating systems implicitly check
the executable directory without traversing the PATH/LD_LIBRARY_PATH/LIBPATH environment
variable.
For more information on the required libraries (.dll files), see Deployment of Java applications in the Interfaces User’s Manual.