Setting environment variables for IBM MQ classes for JMS
Before you can compile and run IBM® MQ classes for JMS applications, the setting for your CLASSPATH environment variable must include the IBM MQ classes for JMS Java archive (JAR) file. Depending on your requirements, you might need to add other JAR files to your class path. To run the scripts provided with IBM MQ classes for JMS, other environment variables must be set.
About this task
To compile and run IBM MQ classes for JMS applications, use the CLASSPATH setting for your platform as shown in Table 1. The setting includes the samples directory, so that you can compile and run the IBM MQ classes for JMS sample applications. Alternatively, you can specify the class path on the java command instead of using the environment variable.
Platform | CLASSPATH setting |
---|---|
AIX® |
CLASSPATH= MQ_INSTALLATION_PATH/java/lib/com.ibm.mqjms.jar:
MQ_INSTALLATION_PATH/samp/jms/samples: |
Linux® |
CLASSPATH= MQ_INSTALLATION_PATH/java/lib/com.ibm.mqjms.jar:
MQ_INSTALLATION_PATH/samp/jms/samples: |
IBM i |
CLASSPATH=/QIBM/ProdData/mqm/java/lib/com.ibm.mqjms.jar:
/QIBM/ProdData/mqm/java/samples/jms/samples: |
Windows |
CLASSPATH= MQ_INSTALLATION_PATH\java\lib\com.ibm.mqjms.jar;
MQ_INSTALLATION_PATH\tools\jms\samples; |
z/OS® |
CLASSPATH= MQ_INSTALLATION_PATH/mqm/V9R2M0/java/lib/com.ibm.mqjms.jar:
MQ_INSTALLATION_PATH/mqm/V9R2M0/java/samples/jms/samples:
CLASSPATH= MQ_INSTALLATION_PATH/mqm/V9R2M2/java/lib/com.ibm.mqjms.jar:
MQ_INSTALLATION_PATH/mqm/V9R2M2/java/samples/jms/samples: |
MQ_INSTALLATION_PATH represents the high-level directory in which IBM MQ is installed.
The manifest of the JAR file com.ibm.mqjms.jar contains references to most of the other JAR files required by IBM MQ classes for JMS applications, and so you do not need to add these JAR files to your class path. These JAR files include those required by applications that use the Java Naming Directory Interface (JNDI) to retrieve administered objects from a directory service and by applications that use the Java Transaction API (JTA).
- If you are using channel exit classes that implement the channel exit interfaces defined in the com.ibm.mq package, instead of those defined in the com.ibm.mq.exits package, you must add the IBM MQ classes for Java JAR file, com.ibm.mq.jar, to your class path.
-
If your application uses JNDI to retrieve administered objects from a directory service, you must
also add the following JAR files to your class path:
- fscontext.jar
- providerutil.jar
- If your application uses the JTA, you must also add jta.jar to your class path.
- 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 JMS is installed.
- MQ_JAVA_LIB_PATH
- This environment variable specifies the directory where the IBM MQ classes for JMS libraries are stored, as shown in Table 1.