title: Cant init context with JMS
body: <p>i have problems with setting up JMS. I tried using Active MQ and OpenJMS but the same error occurs. Iam clueless on how to solve it:</p>
  
  <p>When i execute this: </p>
  
  <pre><code>import javax.naming.Context;
  import javax.naming.InitialContext;
  import javax.naming.NamingException;
  import java.util.Hashtable;
  
  public class Main {
      public static void main(String[] args) throws NamingException {
          Hashtable properties = new Hashtable();
  
          properties.put(Context.INITIAL_CONTEXT_FACTORY,
              "org.exolab.jms.jndi.InitialContextFactory");
          properties.put(Context.PROVIDER_URL, "tcp://localhost:3035/");
  
          Context context = new InitialContext(properties);
      }
  }
  </code></pre>
  
  <p>I get this error:</p>
  
  <pre><code>Exception in thread "main" javax.naming.NoInitialContextException: Cannot instantiate class: org.exolab.jms.jndi.InitialContextFactory [Root exception is java.lang.ClassNotFoundException: org.exolab.jms.jndi.InitialContextFactory]
  </code></pre>
  
  <p>After some googling i think the problem is that a jar is not in the right classpath, but all the answers already assume that i know which jar and where to store it, but this is not the case here.   </p>
  
  <p><strong>Which Jar are they talking about? Where can i get it? Where do i need to store it?</strong></p>
  
  <p>Iam using IntelliJ btw. Could you point me in the right direction?</p>
  
  <p>ActiveMQ is working (<a href="http://localhost:8161/" rel="nofollow noreferrer">http://localhost:8161/</a> shows webpage of ActiveMQ)</p>
  
  <p>Here are my steps on how i created the project:
  File -> New Project -> Java -> SDK1.8 -> Next -> Next -> Project Name: Test -> Right click src folder -> New -> Java Class -> Name: Main -> Paste code from above -> Run -> Error</p>
  
  <p>EDIT: for all the people having the same errors: OpenJMS comes with a libfolder. Install these libraries and it should work</p>