setmqenv
Use the setmqenv to set up the IBM® WebSphere® MQ environment, on UNIX, Linux®, and Windows.
Purpose
You can use the setmqenv script to automatically set up the environment for use with an installation
of IBM WebSphere MQ. Alternatively,
you can use the crtmqenv command to create a list
of environment variables and values to manually set each environment
variable for your system; see crtmqenv for
more information.
Note: Any changes you make to the environment are
not persistent. If you log out, and log in again, your changes are
lost.
You can specify which installation the environment is set up for by specifying a queue manager name, an installation name, or an installation path. You can also set up the environment for the installation that issues the setmqenv command by issuing the command with the -s parameter.
The setmqenv command sets the following environment
variables, appropriate to your system:
- CLASSPATH
- INCLUDE
- LIB
- MANPATH
- MQ_DATA_PATH
- MQ_ENV_MODE
- MQ_FILE_PATH
- MQ_JAVA_INSTALL_PATH
- MQ_JAVA_DATA_PATH
- MQ_JAVA_LIB_PATH
- MQ_JAVA_JVM_FLAG
- MQ_JRE_PATH
- PATH
Usage notes
- If you have installed IBM WebSphere MQ V 7.0.1, do not use the setmqenv command. Some of the components of IBM WebSphere MQ V 7.0.1, such as Explorer, reference the environment variables for their library paths and therefore will not work if the setmqenv command has been used to alter the environment variables to point to an IBM WebSphere MQ V 7.0.1 installation path.
- The setmqenv command removes all directories
for all IBM WebSphere MQ installations
from the environment variables before adding new references to the
installation for which you are setting up the environment for. Therefore,
if you want to set any additional environment variables that reference IBM WebSphere MQ, set the variables
after issuing the setmqenv command. For example,
if you want to add
to LD_LIBRARY_PATH, you must do so after running the setmqenv command.MQ_INSTALLATION_PATH
/java/lib - In some shells, command-line parameters cannot be used with setmqenv and any setmqenv command issued
is assumed to be a
setmqenv -s
command. The command produces an informational message that the command has been run as if asetmqenv -s
command had been issued. Therefore, in these shells you must ensure that you issue the command from the installation for which you want to set the environment for. In these shells, you must set the LD_LIBRARY_PATH variable manually. Use the crtmqenv command with the -l or -k parameter to list the LD_LIBRARY_PATH variable and value. Then use this value to set the LD_LIBRARY_PATH.
Syntax
Optional Parameters
- -m QMgrName
- Set the environment for the installation associated with the queue manager QMgrName.
- -n InstallationName
- Set the environment for the installation named InstallationName.
- -p InstallationPath
- Set the environment for the installation in the path InstallationPath.
- -r
- Remove all installations from the environment.
- -s
- Set the environment for the installation that issued the setmqenv command.
- -k
- UNIX and Linux only.
- -l
- UNIX and Linux only.
- -x Mode
- Mode can take the value 32 or 64.
Return codes
Return code | Description |
---|---|
0 | Command completed normally. |
10 | Command completed with unexpected results. |
20 | An error occurred during processing. |
Examples
The following examples assume that a copy of IBM WebSphere MQ is installed in the /opt/mqm directory on a UNIX or Linux system.Note: The period character
(.)
character used at the beginning
of each command makes the setmqenv script run in
the current shell. Therefore, the environment changes made by the setmqenv script are applied to the current shell. Without
the period character (.)
, the environment variables
are changed in another shell, and the changes are not applied to the
shell from which the command is issued.- The following command sets up the environment for an installation
installed in the /opt/mqm directory:
. /opt/mqm/bin/setmqenv -s
- The following command sets up the environment for an installation
installed in the /opt/mqm2 directory, and includes
the path to the installation at the end of the current value of the LD_LIBRARY_PATH variable:
. /opt/mqm/bin/setmqenv -p /opt/mqm2 -l
- The following command sets up the environment for queue manager
QM1
in a 32-bit environment:. /opt/mqm/bin/setmqenv -m QM1 -x 32
This
command sets up the environment for an installation called
Installation1
: "C:\Program Files\IBM\WebSphere MQ\bin\setmqenv.cmd" -n Installation1