title: NoClassDefFoundError: org/aspectj/lang/Sign
body: <p>I have been trying a simple program to connect MYSQL to my Java app. I am using Windows OS. I used an online tutorial and tried the following program in notepad:</p>
  
  <pre><code>import java.sql.*;
  
  public class Database1{
  static final String JDBC_DRIVER = "com.mysql.jdbc.Driver";  
  static final String DB_URL = "jdbc:mysql://localhost/EMP";
  
  static final String USER = "root";
  static final String PASS = "admin";
  
  public static void main(String[] args) {
  Connection conn = null;
  Statement stmt = null;
  
  try{
     Class.forName("com.mysql.jdbc.Driver");
     System.out.println("Connecting to database...");
  
      conn = DriverManager.getConnection(DB_URL,USER,PASS);
  
      System.out.println("Creating statement...");
      stmt = conn.createStatement();
      ResultSet rs = stmt.executeQuery("SELECT * FROM Employees");
  
      System.out.println("ID             NAME         ");
  
      while(rs.next()){
        String id=rs.getString("ID");
        String name=rs.getString("NAME");
        System.out.print(id);
        System.out.println(name);
  
        }
  
        rs.close();
        stmt.close();
        conn.close();
       } //close try block
      catch(SQLException s){ s.printStackTrace();}
      catch(Exception e){e.printStackTrace();}
  
      finally{
  
    try{
       if(stmt!=null)
          stmt.close();
     }catch(SQLException se2){
     }// nothing we can do
    try{
       if(conn!=null)
          conn.close();
     }catch(SQLException se){
       se.printStackTrace();
     }//end finally try
     }//end try
     System.out.println("Goodbye!");
  
     }//end main
  }
  </code></pre>
  
  <p>I was getting the error:</p>
  
  <pre><code>  C:\JavaP&gt;java -cp .;C:\JavaP\mysql-connector-java-3.1.14-bin-g Database1
    java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
      at java.net.URLClassLoader$1.run(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 java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Unknown Source)
      at Database1.main(Database1.java:17)
     Goodbye!
  </code></pre>
  
  <p>After hours of googling and online searching I was finally able to resolve my problem (-when location of java lib folder (C:\Program Files\Java\jdk1.8.0_05\lib in my case) is maintained in environment variables, none of the java programs could execute.)</p>
  
  <p>But now I am stuck with another issue:</p>
  
  <pre><code> C:\JavaP&gt;java -cp .;C:\JavaP\mysql-connector-java-3.1.14-bin-g.jar Database1
   Exception in thread "main" java.lang.NoClassDefFoundError: org/aspectj/lang/Signature
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Unknown Source)
      at Database1.main(Database1.java:17)
  Caused by: java.lang.ClassNotFoundException: org.aspectj.lang.Signature
      at java.net.URLClassLoader$1.run(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)
      ... 3 more
  </code></pre>