title: Java Email App Builds, Can't Run, Missing ClassDef
body: <pre><code>javac SendEmail.java -cp ".;C:\Program Files\Java\jdk1.8.0_111\jre\lib\javax.mail.jar"
  </code></pre>
  
  <p>Successfully makes SendEmail.class</p>
  
  <pre><code>java SendEmail -cp ".;C:\Program Files\Java\jdk1.8.0_111\jre\lib\javax.mail.jar"
  </code></pre>
  
  <p>Results in:</p>
  
  <pre><code>Error: A JNI error has occurred, please check your installation and try again
  Exception in thread "main" java.lang.NoClassDefFoundError: javax/mail/Address
          at java.lang.Class.getDeclaredMethods0(Native Method)
          at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
          at java.lang.Class.privateGetMethodRecursive(Unknown Source)
          at java.lang.Class.getMethod0(Unknown Source)
          at java.lang.Class.getMethod(Unknown Source)
          at sun.launcher.LauncherHelper.validateMainClass(Unknown Source)
          at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
  Caused by: java.lang.ClassNotFoundException: javax.mail.Address
          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)
          ... 7 more
  </code></pre>
  
  <p>I have tried putting the javax.mail.jar in both the jdk1.8.0_111/jre/lib and the jre1.8.0_111\lib directories. I have tried putting it in the same directory as the SendEmail.java file. I've read the documentation and watched the tutorials. Why is this still happening? I'm using version 1.5.6 of the jar.</p>