Re: Newbie: -classpath option of java does not load the content of the jar file



That does not work either:
C:\_t\Java> java -classpath ojdbc14.jar j
Exception in thread "main" java.lang.NoClassDefFoundError: j

The "j" class is just a quick stub I use to test Java things (I
program mostly in Delphi), then I import the result into my real Java
app:

import java.util.*;
import java.io.*;

import java.sql.*;
import oracle.jdbc.driver.OracleDriver;

public class j
{
public static String OracleDriverName =
"oracle.jdbc.driver.OracleDriver";

public static void main(String args[])
{

System.out.println("Start...");
LoadOracleDriver();
System.out.println("End...");

}

public static boolean LoadOracleDriver ()
{
boolean bStatus = true;

try
{
Class.forName(OracleDriverName);
}
catch ( ClassNotFoundException ex )
{
System.out.println(ex);
bStatus = false;
}

return bStatus;
}
}



.