Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add RabbitMQ library to project? 'The import "com.rabbitmq" cannot be resolved'

I am working through the RabbitMQ Java tutorial found here: https://www.rabbitmq.com/tutorials/tutorial-one-java.html

I have downloaded the Java Client Library package, and copied the JAR files to my project in Eclipse, but the import statements

import com.rabbitmq.client.ConnectionFactory;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.Channel;

all yield the error

The import "com.rabbitmq" cannot be resolved.

The instructions are unclear how to incorporate the JAR files from the Java Client Library package, how should I proceed?

like image 630
jmhummel Avatar asked Jul 26 '15 07:07

jmhummel


People also ask

Does RabbitMQ need Java?

The RabbitMQ Java client library allows Java and JVM-based applications to connect to and interact with RabbitMQ nodes. 5. x release series of this library require JDK 8, both for compilation and at runtime. On Android, this means only Android 7.0 or later versions are supported.

How do I get Amqp in RabbitMQ?

RabbitMQ uses a protocol called AMQP by default. To be able to communicate with RabbitMQ you need a library that understands the same protocol as RabbitMQ. Download the client library for the programming language that you intend to use for your applications.

Is RabbitMQ a library?

The . NET RabbitMQ client library is hosted and developed on GitHub. Please see the . NET client build guide for instructions on compiling from source.

How do I connect to RabbitMQ server?

In order for a client to interact with RabbitMQ it must first open a connection. This process involves a number of steps: Application configures the client library it uses to use a certain connection endpoint (e.g. hostname and port) The library resolves the hostname to one or more IP addresses.


1 Answers

You can download the rabbitmq-java-client-bin-3.5.4.zip from official link here . Then extract the rabbitmq-client.jar from the zip & add it to your class path in project. Then you will be able to resolve The import "com.rabbitmq". Give it a try.

like image 89
AnkeyNigam Avatar answered Sep 24 '22 05:09

AnkeyNigam