> Tutorials > Concert Technology Tutorial for Java Users > Compiling ILOG CPLEX Applications in ILOG Concert Technology |
Compiling ILOG CPLEX Applications in ILOG Concert Technology |
INDEX
![]() |
When compiling a Java program that uses ILOG Concert Technology, you need to inform the Java compiler where to find the file cplex.jar
containing the ILOG CPLEX Concert Technology class library. To do this, you add the cplex.jar
file to your classpath. This is most easily done by passing the command-line option
|
to the Java compiler javac
. If you need to include other Java class libraries, you should add the corresponding jar
files to the classpath as well. Ordinarily, you should also include the current directory '.
' to be part of the Java classpath.
At execution time, the same classpath setting is needed. Additionally, since ILOG CPLEX is implemented via JNI, you need to instruct the Java Virtual Machine (JVM) where to find the shared library (or dynamic link library) containing the native code to be called from Java. This may be done with the command line option
-Djava.library.path=<path_to_shared_library> |
to the java
command. Note that, unlike the cplex.jar
file, the shared library is system dependent; thus the exact pathname, of the location for the library to be used, differs depending on the platform you are using.
Pre-configured compilation and runtime commands are provided in the standard distribution, through the UNIX makefiles and Windows "javamake
" file for Nmake
. However, these scripts presume a certain relative location for the files mentioned above, and for application development most users will have their source files in some other location.
Below are suggestions for establishing build procedures for your application.
readme.html
file in the standard distribution, under the Supported Platforms heading to locate the machine and libformat entry for your UNIX platform, or the compiler and library format combination for Windows.
examples
directory where ILOG CPLEX is installed on your machine. On UNIX, this will be machine/libformat, and on Windows it will be compiler\libformat. This subdirectory will contain a makefile
or javamake
appropriate for your platform.
make execute_java
(UNIX) or nmake -f javamake execute
(Windows).
Copyright © 1987-2003 ILOG, S.A. All rights reserved. Legal terms. | PREVIOUS NEXT |