title: java.lang.ClassNotFoundException: org.owasp.encoder.Encode
body: <p>I am trying to use the OWASP encoder library in my java class to encode input, but I am not having any luck.  It keeps giving me this </p>
  
  <blockquote>
    <p>java.lang.ClassNotFoundException: org.owasp.encoder.Encode and java.lang.NoClassDefFoundError: org/owasp/encoder/Encode</p>
  </blockquote>
  
  <p>I am including the JAR in the <code>-classpath</code> on compilation. Not sure what else to try</p>
  
  <pre><code>/usr/java/jdk1.6.0_20/bin/javac -classpath /path:/path/encoder-1.1.1.jar xxxx.java
  </code></pre>
  
  <p>Here is the stack trace:</p>
  
  <pre><code>java.lang.ClassNotFoundException: org.owasp.encoder.Encode
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1701)
      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1546)
      at xxxxxx.doGet(xxxxxx.java:15)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
      at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
      at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
      at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
      at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:309)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:619)
  </code></pre>
  
  <p>Thanks</p>