ILOG CPLEX 11.0 Getting Started > Tutorials > Concert Technology Tutorial for Java Users > Compiling ILOG CPLEX in ILOG Concert Technology Java Applications |
Compiling ILOG CPLEX in ILOG Concert Technology Java Applications |
INDEX PREVIOUS NEXT |
When compiling a Java application 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
-classpath <path_to_cplex.jar>
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. You indicate this location 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 may differ depending on the platform you are using.
Copyright © 1987-2007 ILOG S.A. All rights reserved. Legal terms. | PREVIOUS NEXT |