Environment variables relevant to IBM MQ classes for Java
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.Platform | CLASSPATH setting |
---|---|
AIX |
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: |
Linux |
CLASSPATH= MQ_INSTALLATION_PATH/java/lib/com.ibm.mq.jar: MQ_INSTALLATION_PATH/samp/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/V9R1M0/java/lib/com.ibm.mq.jar: MQ_INSTALLATION_PATH/mqm/V9R1M0/java/samples/wmqjava: MQ_INSTALLATION_PATH/mqm/V9R1M0/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 you have installed 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 UNIX, we can use the script setjmsenv (if we are using a 32-bit JVM) or setjmsenv64 (if we 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.
Parent topic: What is installed for IBM MQ classes for Java