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 CLASSPATH= MQ_INSTALLATION_PATH/java/lib/com.ibm.mq.jar:
MQ_INSTALLATION_PATH/samp/wmqjava/samples:
HP-UX, Linux , and Solaris CLASSPATH= MQ_INSTALLATION_PATH/java/lib/com.ibm.mq.jar:
MQ_INSTALLATION_PATH/samp/wmqjava/samples:
IBM i CLASSPATH=/QIBM/ProdData/mqm/java/lib/com.ibm.mq.jar:
/QIBM/ProdData/mqm/java/samples/wmqjava/samples:
Windows CLASSPATH= MQ_INSTALLATION_PATH\Java\lib\com.ibm.mq.jar;
MQ_INSTALLATION_PATH\tools\wmqjava\samples;
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. We can ignore the warning. This file is only present if we have installed Advanced Message Security.

The scripts provided with IBM MQ classes for JMS use the following environment variables:

On Windows, all the environment variables are set automatically during installation.

On UNIX, we 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 UNIX and Linux, these scripts are in the MQ_INSTALLATION_PATH/java/bin directory.

On IBM i, the environment variable QIBM_MULTI_THREADED must be set to Y. We can then run multithreaded applications in the same way that you run single threaded applications. See Set 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.