Context:
My aim is to simply run a RabbitMQ receiver (in Java) that would accept and print the messages to the console. I have another service that would be sending the messages to this receiver. Everything happens with the default config (ports, localhost, etc.).
Steps followed:
I am trying to follow this RabbitMQ tutorial.
As mentioned towards the end of the tutorial, to compile the Recv.java application, I run the following command (similar to the one given):
javac -cp amqp-client-5.5.1.jar Recv.java
Note that I manually downloaded the
amqp-client-5.5.1.jar
file and have copied it to/Library/Java/Extensions
as mentioned in this SO answer.
Error:
When I try to run my application, I get many errors like below:
Recv.java:1: error: package com.rabbitmq.client does not exist
import com.rabbitmq.client.Channel;
//------------------------^
Recv.java:2: error: package com.rabbitmq.client does not exist
import com.rabbitmq.client.Connection;
//------------------------^
Recv.java:3: error: package com.rabbitmq.client does not exist
import com.rabbitmq.client.ConnectionFactory;
//------------------------^
Recv.java:4: error: package com.rabbitmq.client does not exist
import com.rabbitmq.client.DeliverCallback;
...
Obviously, it is unable to find the packages to run. However, the tutorial does not elaborate much and so I am unable to proceed. I tried running the RabbitMQ Java client, but its README.md
does not have how to run instructions either. Oh, there was one other SO answer which talked about some rabbitmq-client.jar
file, but that is not mentioned anywhere in the tutorial or the README.md, so I am not sure I that answer was helpful.
How could I run this?