Environment variables relevant to IBM MQ classes for Java

If you want to run IBM® MQ classes for Java applications, their class path must include the IBM MQ classes for Java and samples directories.

For IBM MQ classes for Java, applications to run, their class path must include the appropriate IBM MQ classes for Java directory. To run the sample applications, the class path must also include the appropriate samples directories. This information can be provided in the Java invocation command or in the CLASSPATH environment variable.

Important: Setting the Java option -Xbootclasspath, to include the IBM MQ classes for Java, is not supported.
Table 1 shows the appropriate CLASSPATH setting to use on each platform to run IBM MQ classes for Java applications, including the sample applications.
Table 1. CLASSPATH setting to run IBM MQ classes for Java applications, including the IBM MQ classes for Java sample applications
Platform CLASSPATH setting
[AIX]AIX® [AIX]
CLASSPATH= MQ_INSTALLATION_PATH/java/lib/com.ibm.mq.jar:
MQ_INSTALLATION_PATH/samp/wmqjava/samples:
[Solaris][HP-UX][Linux]HP-UX, Linux®, and Solaris [Solaris][HP-UX][Linux]
CLASSPATH= MQ_INSTALLATION_PATH/java/lib/com.ibm.mq.jar:
MQ_INSTALLATION_PATH/samp/wmqjava/samples:
[IBMi]IBM i [IBMi]
CLASSPATH=/QIBM/ProdData/mqm/java/lib/com.ibm.mq.jar:
/QIBM/ProdData/mqm/java/samples/wmqjava/samples:
[Windows]Windows [Windows]
CLASSPATH= MQ_INSTALLATION_PATH\Java\lib\com.ibm.mq.jar;
MQ_INSTALLATION_PATH\tools\wmqjava\samples;
[z/OS]z/OS® [z/OS]
CLASSPATH= MQ_INSTALLATION_PATH/mqm/V8R0M0/java/lib/com.ibm.mq.jar:
MQ_INSTALLATION_PATH/mqm/V8R0M0/java/samples/wmqjava:
MQ_INSTALLATION_PATH/mqm/V8R0M0/java/samples/pcf

MQ_INSTALLATION_PATH represents the high-level directory in which IBM MQ is installed.

If you compile using the -Xlint option, you might see a message warning you that com.ibm.mq.ese.jar is not present. You can ignore the warning. This file is only present if you have installed IBM MQ Advanced Message Security.

The scripts provided with IBM MQ classes for JMS use the following environment variables:
MQ_JAVA_DATA_PATH
This environment variable specifies the directory for log and trace output.
MQ_JAVA_INSTALL_PATH
This environment variable specifies the directory where IBM MQ classes for Java are installed, as shown in IBM MQ classes for Java installation directories.
MQ_JAVA_LIB_PATH
This environment variable specifies the directory where the IBM MQ classes for Java libraries are stored, as shown in The location of the IBM MQ classes for Java libraries for each platform. Some scripts supplied with IBM MQ classes for Java, such as IVTRun, use this environment variable.

On Windows, all the environment variables are set automatically during installation. On any other platform, you must set them yourself. On a UNIX system, you can use the script setjmsenv (if you are using a 32-bit JVM) or setjmsenv64 (if you are using a 64-bit JVM) to set the environment variables. On AIX, HP-UX, Linux, and Solaris, these scripts are in the MQ_INSTALLATION_PATH/java/bin directory.

[IBMi]On IBM i, the environment variable QIBM_MULTI_THREADED must be set to Y. You can then run multithreaded applications in the same way that you run single threaded applications. See Setting up IBM MQ with Java and JMS for more information.

IBM MQ classes for Java require a Java 7 Java Runtime Environment (JRE). For information about the location of a suitable JRE that is installed with IBM MQ, see Installation directories for IBM MQ classes for Java.