title: Trouble integrating BouncyCastle Jar
body: <p>Okay, I'll say now that I know very little about Java. I was given the Bouncy Castle Jar and told that would contain what I needed to do this assignment. The Jar file is <code>bcprov-jdk15on-147.jar</code>. I'm also doing this on a Unix machine maintained by my school, so I can't go in and play with all of the Java files.</p>
  
  <p>When I compile my class using Javac (specifically I use the command <code>javac -classpath bcprov-jdk15on-147.jar encrypt.java</code>), it compiles without error, but when I go to run the program afterward using the command <code>java encrypt</code>, I get this error message:</p>
  
  <pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: org/bouncycastle/jce/provider/BouncyCastleProvider
  Caused by: java.lang.ClassNotFoundException: org.bouncycastle.jce.provider.BouncyCastleProvider
  at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
  at java.security.AccessController.doPrivileged(Native Method)
  at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
  at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
  at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
  </code></pre>
  
  <p>My Jar file is located in my main folder with all of my other files, just in case it has to go somewhere special and that's what I didn't do.</p>
  
  <p>When I do <code>java -classpath bcprov-jdk15on-147.jar encrypt</code> this is the error I get:</p>
  
  <pre><code>    Exception in thread "main" java.lang.NoClassDefFoundError: encrypt
  Caused by: java.lang.ClassNotFoundException: encrypt
      at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
      at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
  </code></pre>
  
  <p>Why am I having trouble running the compiled program?</p>