title: How to run RabbitMQ Java receiver?
body: <p><strong>Context:</strong></p>
  
  <p>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.).</p>
  
  <p><strong>Steps followed:</strong></p>
  
  <ol>
  <li><p>I am trying to follow <a href="https://www.rabbitmq.com/tutorials/tutorial-one-java.html" rel="nofollow noreferrer">this RabbitMQ tutorial</a>.  </p></li>
  <li><p>As mentioned towards the end of the tutorial, to compile the <a href="https://github.com/rabbitmq/rabbitmq-tutorials/blob/master/java/Recv.java" rel="nofollow noreferrer">Recv.java</a> application, I run the following command (similar to the one given): <br> <code>javac -cp amqp-client-5.5.1.jar Recv.java</code></p></li>
  <li><p>Note that I manually downloaded the <code>amqp-client-5.5.1.jar</code> file and have copied it to <code>/Library/Java/Extensions</code> as mentioned in this <a href="https://stackoverflow.com/questions/1675765/adding-to-the-classpath-on-osx">SO answer</a>.</p></li>
  </ol>
  
  <p><strong>Error:</strong></p>
  
  <p>When I try to run my application, I get many errors like below:</p>
  
  <blockquote>
    <p>Recv.java:1: error: package com.rabbitmq.client does not exist<br>
    import com.rabbitmq.client.Channel;<br>
    //------------------------^<br>
    Recv.java:2: error: package com.rabbitmq.client does not exist<br>
    import com.rabbitmq.client.Connection;<br>
    //------------------------^<br>
    Recv.java:3: error: package com.rabbitmq.client does not exist<br>
    import com.rabbitmq.client.ConnectionFactory;<br>
    //------------------------^<br>
    Recv.java:4: error: package com.rabbitmq.client does not exist<br>
    import com.rabbitmq.client.DeliverCallback;<br>
    ...</p>
  </blockquote>
  
  <p>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 <a href="https://github.com/rabbitmq/rabbitmq-java-client" rel="nofollow noreferrer">RabbitMQ Java client</a>, but its <code>README.md</code> does not have how to run instructions either.  Oh, there was one other <a href="https://stackoverflow.com/questions/19406864/rabbitmq-java-client-java-dependencies-standard-libraries">SO answer</a> which talked about some <code>rabbitmq-client.jar</code> file, but that is not mentioned anywhere in the tutorial or the README.md, so I am not sure I that answer was helpful.</p>
  
  <p>How could I run this?</p>