How to Compile an Application

You need to compile the JMS client application.
iMQ supports JDK1.1.8 or higher for Solaris and Windows, and 1.3 for Linux.

You need to include the following jar files (located in <JMQ_HOME/lib> in your CLASSPATH in order to compile the sample client application.

When you install iMQ, the JMQ_HOME environment variable is set.  Check to make sure it is properly set.

>set JMQ_HOME
JMQ_HOME=D:\Program Files\iPlanetMessageQueue2.0

You can compile the application using the following command.

>javac -classpath "%JMQ_HOME%\lib\jms.jar;%JMQ_HOME%\lib\jmq.jar;%JMQ_HOME%\lib\jndi.jar;." SampleClient.java
 

Tips for UNIX Users:
The JMQ_HOME environment variable is not set by the installer on Solaris and Linux.  You may want to execute the following command to set it.

>setenv JMQ_HOME /opt/SUNWjmq

You can compile the application using the following command.

>javac -classpath "$JMQ_HOME/lib/jms.jar:$JMQ_HOME/lib/jmq.jar:$JMQ_HOME/lib/jndi.jar:." SampleClient.java
 


How to Run an Application

In addition to the above jar files, you will also need to include

Make sure that the JMQ_HOME environment variable is set properly.

>set JMQ_HOME
JMQ_HOME=D:\Program Files\iPlanetMessageQueue2.0

You can run the application using the following command.

>java -classpath "%JMQ_HOME%\lib\jms.jar;%JMQ_HOME%\lib\jmq.jar;%JMQ_HOME%\lib\jndi.jar;%JMQ_HOME%\lib\providerutil.jar;%JMQ_HOME%\lib\fscontext.jar;." SampleClient

The applicaion is run successfully when you see the following messages.

Publishing a message to Queue: my_test_queue
Received the following message: Hello World
 

Tips for UNIX Users:
The JMQ_HOME environment variable is not set by the installer on Solaris and Linux.  You may want to execute the following command to set it.

>setenv JMQ_HOME /opt/SUNWjmq

You can run the application using the following command (after setting the JMQ_HOME environment variable.)

>java -classpath "$JMQ_HOME/lib/jms.jar:$JMQ_HOME/lib/jmq.jar:$JMQ_HOME/lib/jndi.jar:$JMQ_HOME/lib/providerutil.jar:$JMQ_HOME/lib/fscontext.jar:." SampleClient
 

Tips for LDAP Users:
Instead of fscontext.jar, include ldap.jar, if you want to use the bundled LDAP service provider implementation.

On Windows:
>java -classpath "%JMQ_HOME%\lib\jms.jar;%JMQ_HOME%\lib\jmq.jar;%JMQ_HOME%\lib\jndi.jar;%JMQ_HOME%\lib\providerutil.jar;%JMQ_HOME%\lib\ldap.jar;." SampleClient

On UNIX:
>java -classpath "$JMQ_HOME/lib/jms.jar:$JMQ_HOME/lib/jmq.jar:$JMQ_HOME/lib/jndi.jar:$JMQ_HOME/lib/providerutil.jar:$JMQ_HOME/lib/ldap.jar:." SampleClient
 

<<Back <<     <<Return to TOC>>