Subject Re: [Firebird-Java] NoClassDefFoundError
Author Gabriel Reid
On Fri, Sep 09, 2005 at 01:25:17AM -0000, digitry wrote:
> My program runs just fine inside Eclipse 3.1, but when I try to run it
> from a command prompt, it fails very near the beginning with
> NoClassDefFoundError: org/firebirdsql/jdbc/FBDriver. The relevant line
> of code is
> DriverManager.registerDriver(new org.firebirdsql.jdbc.FBDriver ());
> I get similar results with
> Class.forName("org.firebirdsql.jdbc.FBDriver");
>
> I'm guessing that the problem has to be the CLASSPATH. JayBird --
> including its jars, especially firebirdsql-full.jar -- is in the
> directory C:\Program Files\FireBird\JayBird155. I've tried both that
> and C:\PROGRA~1\FireBird\JayBird155 in the CLASSPATH (one after the
> other, not both at once). For example, my current CLASSPATH is
> .;C:\PROGRA~1\Java\jre1.5.0_04\lib;C:\PROGRA~1\FireBird\JayBird155;
> C:\BlahBlah\Utils;

The actual jar file (and not just the directory containing it) has to be
the classpath. One of the elements of your classpath should be:
C:\PROGRA~1\FireBird\JayBird155\firebirdsql-full.jar


Gabriel