JMS application. This is a very easy task in Windows, but since, I am new to linux, some easy tasks became so annoying!!! But later I realized it was much simpler once you get the hang of it. So, here are the steps to run a JMS application on Linux (Ubuntu 9.10)
Download JBOSS 4.3.2 to your desktop and extract the tar.gz or zip file ot /opt folder in the main file system.> “sudo unzip boss-4.2.3.GA-jdk6.zip /opt”> And you are done with your JBOSS installation!!> Go to your terminal and type “sudo /opt/jboss-4.2.3.GA/bin/run.sh”. This will start you JBOSS server in 20–25 seconds.
This was the most annoying part for me since I didn’t know how to set the environment variable in Linux. Though its a very very easy process!> Execute this following code in the terminal:> export CLASSPATH=$CLASSPATH:/CLASSPATH=/opt/jboss-4.2.3.GA/client/jbossall-client.jar
To check if you have set the CLASSPATH correctly, type echo $CLASSPATH and if you see the following, you see this, you have set your classpath correctly!> :/CLASSPATH=/opt/jboss-4.2.3.GA/client/jbossall-client.jar
Go to Eclipse IDE and import your JMS Code. The most simple code should contain 2 files, a client and a server. Then right click on the project > Build Path > Add External Archives; then browse to the folder where you installed JBOSS, (/opt/jboss-4.2.3.GA/) in our case and then go to client folder and add jbossall-client.jar> /opt/jboss-4.2.3.GA/client/jbossall-client.jar> **You are all set to run your first JMS application!**> You need to create a topic or queue to run the server, for this start the JBOSS server using:> sudo /opt/jboss-4.2.3.GA/bin/run.sh
If you want to start and stop the JBOSS server from your Eclipse installation then add the JBOSS Tools to eclipse in Help > Software Updates. You can follow the steps given in this tutorial.