title: How to add jars to JMeter's classpath in non-GUI mode
body: <p>I have created a test plan in the JMeter GUI which uses the "Java Request Sampler".</p>
  
  <p>I added the jarfile which contains the implementation to my sampler to /lib/ext/ of my jmeter installation.</p>
  
  <p>This all works fine when I run it in GUI mode.</p>
  
  <p>However when I switch to non gui mode using</p>
  
  <pre><code>./jmeter -n -t Test\ Plan.jmx 
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>com.mycompany.JavaSamplerTest java.lang.ClassNotFoundException
  
  2014/01/23 15:25:25 ERROR - jmeter.protocol.java.sampler.JavaSampler: StandardJMeterEngine@5efbfd6e-Java Request    Exception initialising: com.mycompany.JavaSamplerTest java.lang.ClassNotFoundException: com.mycompany.JavaSamplerTest
  at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
  at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
  at java.lang.Class.forName0(Native Method)
  at java.lang.Class.forName(Class.java:270)
  at org.apache.jmeter.protocol.java.sampler.JavaSampler.initClass(JavaSampler.java:117)
  at org.apache.jmeter.protocol.java.sampler.JavaSampler.testStarted(JavaSampler.java:263)
  at org.apache.jmeter.engine.StandardJMeterEngine.notifyTestListenersOfStart(StandardJMeterEngine.java:214)
  at org.apache.jmeter.engine.StandardJMeterEngine.run(StandardJMeterEngine.java:336)
  at java.lang.Thread.run(Thread.java:744)
  </code></pre>
  
  <p>I have no clue why this behaves differently when using <code>-n -t</code>. Does anybody have a solution to this?</p>
  
  <p>I work on Linux using openjdk if this is somehow a helpful information.</p>