Java Reference
In-Depth Information
The
build.xml
file for each example contains Ant targets that compile, package, and
deploy the example. The targets place the
.class
file for the example in the
build/
jar
directory. Then the targets use the
jar
command to package the class file and the
manifest file in an application client JAR file.
Because the examples use the common interfaces, you can run them using either a queue
or a topic.
To Build and Package the Clients for the Synchronous Receive Example Using NetBeans IDE
1. From the File menu, choose Open Project.
2. In the Open Project dialog, navigate to:
tut-install
/examples/jms/simple/
3. Select the
producer
folder.
4. Select the Open as Main Project check box.
5. Click Open Project.
6. In the Projects tab, right-click the project and select Build.
7. From the File menu, choose Open Project again.
8. Select the
synchconsumer
folder.
9. Select the Open as Main Project check box.
10. Click Open Project.
11. In the Projects tab, right-click the project and select Build.
To Deploy and Run the Clients for the Synchronous Receive Example Using NetBeans IDE
1. Deploy and run the
Producer
example:
a. Right-click the
producer
project and select Properties.
b. Select Run from the Categories tree.
c. In the Arguments field, type the following:
queue 3
d. Click OK.
e. Right-click the project and select Run.
The output of the program looks like this (along with some additional output):