title: java ClassNotFoundException for org.h2.Driver
body: <p>I am trying to use <a href="http://www.h2database.com/html/main.html" rel="noreferrer">H2</a> to connect to a database in Java (using Eclipse as the IDE). The sample does (below) throws a <code>ClassNotFoundException</code>. The thing is, I <em>did</em> add the h2 jar file to the system CLASSPATH. I have even checked it's there several times via <code>printenv</code> in the console. Am I omitting a step?</p>
  
  <p>CODE:</p>
  
  <pre><code>import java.sql.*;
  
  public class Program {
  
   /**
    * @param args
    */
   public static void main(String[] args) 
    throws Exception{
  
    try{
     System.out.println("hello, world!");
     Class.forName("org.h2.Driver");
     Connection conn = DriverManager.getConnection("jdbc:h2:~/testdb", "sa", "");
     // add application code here
     conn.close();
    }catch(ClassNotFoundException ex){
     System.out.println( "ERROR: Class not found: " + ex.getMessage() );
  
    }
    System.exit(0);
  
   }
  
  }
  </code></pre>