title: java.lang.NoClassDefFoundError: javax/mail/Authenticator in javaMail
body: <p>I Create a java application that uses send mail, and it working in  eclipse when I run. but when i make it jar and run in Terminal(I am Using Ubuntu) <code>java -jar EmailApp.jar</code>  it give Following Error :</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/Authenticator
      at java.lang.Class.getDeclaredMethods0(Native Method)
      at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
      at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
      at java.lang.Class.getMethod0(Class.java:3018)
      at java.lang.Class.getMethod(Class.java:1784)
      at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
      at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
  Caused by: java.lang.ClassNotFoundException: javax.mail.Authenticator
      at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      ... 7 more
  </code></pre>
  
  <p>My <strong>META-INF/MANIFEST.MF</strong> :</p>
  
  <pre><code>Manifest-Version: 1.0
  Main-Class: com.abc.client.xyz.EmailSender
  Class-Path: lib/javax.mail-1.3.3.01.jar 
   lib/mail-1.4.7.jar
   lib/activation-1.1.1.jar 
   lib/commons-logging-1.1.jar 
   lib/log4j-1.2.12.jar 
   lib/commons-collections.jar 
   lib/commons-dbcp-1.2.1.jar 
   lib/commons-dbutils-1.0.jar 
   lib/commons-email-1.1.jar 
   lib/commons-io.jar 
   lib/commons-lang-2.5.jar 
   lib/commons-pool-1.2.jar 
   lib/commons-pool-20030825.183949.jar 
   lib/jtds-1.2.5.jar 
   lib/mysql-connector.jar 
   lib/idc-dgps4-egn-1.0-SNAPSHOT.jar
  </code></pre>
  
  <p>The Result of <code>$ ls -al ./lib</code></p>
  
  <pre><code>total 17100
  drwxrwxr-x  2 xyz xyz     4096 Oct  7 15:21 .
  drwxrwxr-x 10 xyz xyz     4096 Oct  7 14:26 ..
  -rw-rw-r--  1 xyz xyz    69409 Oct  5 19:20 activation-1.1.1.jar
  -rw-rw-r--  1 xyz xyz   575389 Oct 16  2014 commons-collections.jar
  -rw-rw-r--  1 xyz xyz   107631 Oct 16  2014 commons-dbcp-1.2.1.jar
  -rw-rw-r--  1 xyz xyz    26687 Oct 16  2014 commons-dbutils-1.0.jar
  -rw-rw-r--  1 xyz xyz    30651 Oct 16  2014 commons-email-1.1.jar
  -rw-rw-r--  1 xyz xyz    52543 Oct 16  2014 commons-exec-1.1.jar
  -rw-rw-r--  1 xyz xyz    83613 Oct 16  2014 commons-io.jar
  -rw-rw-r--  1 xyz xyz   279193 Oct 16  2014 commons-lang-2.5.jar
  -rw-rw-r--  1 xyz xyz    52915 Oct 16  2014 commons-logging-1.1.jar
  -rw-rw-r--  1 xyz xyz    42492 Oct 16  2014 commons-pool-1.2.jar
  -rw-rw-r--  1 xyz xyz    38815 Oct 16  2014 commons-pool-20030825.183949.jar
  -rw-rw-r--  1 xyz xyz   865430 Oct 16  2014 idc-dgps4-egn-1.0-SNAPSHOT.jar
  -rw-rw-r--  1 xyz xyz   355030 Jul 11  2015 javax.mail-1.3.3.01.jar
  -rw-rw-r--  1 xyz xyz   708951 Oct 16  2014 js-1.6R5.jar
  -rw-rw-r--  1 xyz xyz   302284 Oct 16  2014 jtds-1.2.5.jar
  -rw-rw-r--  1 xyz xyz   358085 Oct 16  2014 log4j-1.2.12.jar
  -rw-rw-r--  1 xyz xyz   521157 Oct  7 15:20 mail-1.4.7.jar
  -rw-rw-r--  1 xyz xyz   397032 Sep 29 11:06 mysql-connector.jar
  -rw-rw-r--  1 xyz xyz 12598097 Oct 16  2014 tools.jar
  </code></pre>
  
  <p>NOTE : All the .Jar file in /lib folder.</p>
  
  <p>My Application Structure :</p>
  
  <p><a href="https://i.stack.imgur.com/Ckej4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ckej4.png" alt="enter image description here"></a></p>
  
  <p>Please Help Me.</p>