title: Runtime execution (JAR) cannot locate Java CLASSPATH and Connector J
body: <p>before now, my application has always compiled and executed.  I just do my compilation using</p>
  
  <p><strong>jar cvmf mainClass.txt starcoder.jar <em>.class images/</em>.gif images/*.jpg *.bat</strong></p>
  
  <p>I have a </p>
  
  <p>**Windows 7 OS,
  Java JDK jdk1.7.0_05,<br>
  JRE JRE7,
  Connector J mysql-connector-java-3.1.14-bin,
  Using a TextPad for development,</p>
  
  <p>The runtime is on C:/Program Files/Java and Java_home**</p>
  
  <p>This application from TextPad, it runs well with the CLASSPATH and executes fine.
  The system compiles properly but my JAR file fails to execute</p>
  
  <p><strong>PROBLEM</strong>:  It fails to find my CLASSPATH on runtine execution(which works perfectly on compile time) giving me this Error</p>
  
  <blockquote>
    <p>c:\Program Files (x86)\Java\jdk1.7.0_05\bin>java -jar starcoder.jar
    ClassNotFoundException: com.mysql.jdbc.Driver SQLException: No
    suitable driver found for jdbc:mysql://localhost/starinv?user=r oot
    Exception in thread "main" java.lang.NoClassDefFoundError:
    javax/mail/MessagingE xception
            at serialz.(serialz.java:96)
            at serialz.main(serialz.java:240) Caused by: java.lang.ClassNotFoundException: javax.mail.MessagingException
            at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinCla
    ssLoader.java:583)
            at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(C
    lassLoaders.java:178)
            at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
            ... 2 more</p>
  </blockquote>
  
  <p>The CLASSPATH </p>
  
  <blockquote>
    <p>.;C:\Program Files (x86)\Java\jre7\lib\ext\comm.jar;.;C:\Program Files
    (x86)\Java\jre7\lib\ext\mysql-connector-java-3.1.14-bin.jar;.;C:\Program
    Files (x86)\Java\jre7\lib\ext\jxl.jar;.;C:\Program Files
    (x86)\Java\jre7\lib\ext\mailapi.jar;.;C:\Program Files
    (x86)\Java\jre7\lib\ext\mail.jar;.;C:\Program Files
    (x86)\Java\jre7\lib\ext\activation.jar;.;C:\Program Files
    (x86)\Java\jre7\lib</p>
  </blockquote>
  
  <p>My connector J file is in the right location but I get an error while executing my JAR file.</p>
  
  <p>I need help to resolve this.
  is the same for both my development and runtime environment.</p>