title: java.lang.ClassNotFoundException: org.apache.commons.text.WordUtils
body: <p>I can't figure out why I'm getting a ClassNotFoundException here, since I have compiled with the appropriate jar file for WorkUtils, and the class WordUtils is clearly in the jar file.  </p>
  
  <p>I compiled with <code>javac -d bin -cp lib/commons-text-1.2.jar MyClass.java</code>
  and run with <code>java -cp bin MyClass</code></p>
  
  <p>Here is my java class:</p>
  
  <pre><code>import org.apache.commons.text.WordUtils;
  
  class MyClass
  {
      public static void main(String[] args) {
  
          System.out.println(WordUtils.capitalize("sample text"));
  
      }
  }
  </code></pre>
  
  <p>I get this error:</p>
  
  <pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/text/WordUtils
      at MyClass.main(MyClass.java:11)
  Caused by: java.lang.ClassNotFoundException: org.apache.commons.text.WordUtils
      at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
  </code></pre>
  
  <p>Anyone know what could be going wrong here?  </p>