Following is a list of problems and solutions related to the use of the MOSEK Java API.
The Java compiler (javac) or VM (java) says all symbols in mosek... are undefined.
The CLASSPATH environment variable does not contain the path to mosek.jar.
In MS Windows the path is specified as for example
C:\MOSEKINSTALLATION\JAVA\MOSEK.JAR
and the single paths in the classpath are seperated by “;” (semicolon), for example
C:\MOSEKINSTALLATION\JAVA\MOSEK.JAR;C:\OTHERJAVADIR\CLASSES;C:\JAPPS\CLASSES
Under any unix the path is specified as for example
/mosekinstallation/java/mosek.jar
and the single paths in the classpath is seperated by “:” (colon), for example
/mosekinstallation/java/mosek.jar;/otherjavadir/classes;/japps/classes
Note that the classpath may also be specified as a parameter to the Java compiler or VM (-classpath CLASSPATH).
The Java compiler or VM still says it cannot find the symbols defined in the MOSEK package.
All the symbols in the MOSEK Java API are defined in the package mosek, meaning that for example the MosekEnv is actually mosek.MosekEnv unless there is an import mosek.* in the application (see examples).
The application starts, but stops with an exception saying that the Java VM cannot find or load the library “mosekjava” or “mosek_X_Y”.
The Java VM needs to be able to locate the dynamic library mosekjava and mosek_X_Y.
On MS Windows this is done by adding the directory where mosekjava.dll resides to the PATH environment variable (or by copying the library to the directory of the Java application).
On unix it is done by adding the path of the library libmosekjava.so to the environment variable LD_LIBRARY_PATH.
Finally, on 64bit systems, make sure that both Java and the mosek installation are either both 64bit or both 32bit. Executing
java -version
will print the relevant Java version information.