title: How to set path of ojdbc.jar for a basic java app in linux?
body: <p>I'm trying to connect my basic JavaRMI app to an oracle database.
  But I'm stuck with the ojdbc jar and <code>ClassNotFoundException</code>.
  I can't use some IDE (teacher don't want), so I have to do all by notepad and terminal prompt.
  I use Ant to compile the application.
  There is the structure :
  - Build (contains all .class and stub)
  - lib/oracle/ (conatains the oracle-full package found on the website, with ojdbc7.jar)
  - src (contains all .java)
  - build.xml (for ant)</p>
  
  <p>I founded that I must use <code>Class.forName("oracle.jdbc.driver.OracleDriver");</code>. But didn't work alone.
  So next i founded some people who said that we have to set the classpath,
  so I do :
   <code>export CLASSPATH=$CLASSPATH:./lib/oracle/ojdbc7.jar</code> but nothing happens.
  I begin to try with Maven but I've surrender because the dependencies can't be dowload easily (Oracle license).</p>
  
  <p>See behind an extract of my code :</p>
  
  <pre><code>import java.rmi.server.*;
  import java.net.*;
  import java.rmi.*;
  import java.sql.*;
  import java.util.ArrayList;
  
  public class ObjectFactoryCompte extends UnicastRemoteObject implements IObjectFactoryCompte {
      private Connection dbConnection;
      private ArrayList&lt;Compte&gt; instantiatedAccounts = new ArrayList&lt;Compte&gt;();
  
      public static void main(String[] args) {
          try {
            ObjectFactoryCompte serveur = new ObjectFactoryCompte();
            String nom = "compteFactory";
            // Enregistrement
            Naming.rebind(nom, serveur);
            System.out.println("Serveur enregistré avec succès !");
          } catch (Exception e) {
            System.err.println("Erreur : " + e);
          }
      }
  
      public ObjectFactoryCompte() throws RemoteException {
          super();
          try {
              connectToDatabase();
          } catch (ClassNotFoundException e) {
              System.err.println("Impossible de trouver le .jar correspondant au jdbc Oracle.");
              System.err.println("Fin de l'application.");
              System.exit(2);
          } catch (SQLException e) {
              System.err.println("Une erreur s'est produite lors de la connexion à la base de données avec pour cause :");
              e.printStackTrace();
              System.err.println("Fin de l'application.");
              System.exit(1);
          }
      }
  
      private void connectToDatabase() throws ClassNotFoundException, SQLException {
          Class.forName("oracle.jdbc.driver.OracleDriver");
          String host = "jdbc:oracle:thin:@srv:port:thing";
          String user = "usr";
          String pwd = "pwd";
          dbConnection = DriverManager.getConnection(host, user, pwd);
      }
  }
  </code></pre>
  
  <p>Can you help me to clear this issue please ?
  I'm running out of idea... :/</p>
  
  <p>Thanks</p>