title: String encryption with Jasypt library
body: <p>I want to encrypt a string, but the standard Java libraries are too complicated for me.</p>
  <p>So I turned to <a href="http://www.jasypt.org/index.html" rel="nofollow noreferrer">Jasypt</a> labriry. It's pretty simple to use and understan. However when I import the library to Eclipse 3.6 and when I try encrypt a string like &quot;Hello&quot; with the password &quot;123&quot;, it always comes up with an error. I'm not sure what I'mm doing wrong but I think it also happens when I use other libraries in Eclipse.</p>
  <p>Source:</p>
  <pre><code>import org.jasypt.util.text.BasicTextEncryptor;
  
  public class Main {
  
      static BasicTextEncryptor textEncryptor = new BasicTextEncryptor();
  
      public static void main(String[] args) {
          System.out.println(&quot;Hello World&quot;);
          textEncryptor.setPassword(&quot;123&quot;);
          System.out.println(textEncryptor.encrypt(&quot;Hello World&quot;));
      }
  }
  </code></pre>
  <p>The error message:</p>
  <pre><code>java.lang.NoClassDefFoundError: org/apache/commons/lang/exception/NestableRuntimeException
   at java.lang.ClassLoader.defineClass1(Native Method)
   at java.lang.ClassLoader.defineClassCond(Unknown Source)
   at java.lang.ClassLoader.defineClass(Unknown Source)
   at java.security.SecureClassLoader.defineClass(Unknown Source)
   at java.net.URLClassLoader.defineClass(Unknown Source)
   at java.net.URLClassLoader.access$000(Unknown Source)
   at java.net.URLClassLoader$1.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   at org.jasypt.util.text.BasicTextEncryptor.&lt;init&gt;(BasicTextEncryptor.java:67)
   at eMain.&lt;clinit&gt;(eMain.java:4)
  Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang.exception.NestableRuntimeException
   at java.net.URLClassLoader$1.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   ... 14 more
  </code></pre>