Link to home
Start Free TrialLog in
Avatar of Andrei Rodionov
Andrei RodionovFlag for Russian Federation

asked on

NoClassDefFoundError with my jar-application using Oracle JDBC driver

Hi ppl,

There's an application uses Oracle JDBC driver. When I run it  as .class-files thru java <mypackage.myMainClass> it works fine. Now I've made a jar-version of my application. But when I run it as java -jar <myjar> I've got Exception in thread "main" java.lang.NoClassDefFoundError: oracle/jdbc/driver/OracleDriver

My CLASSPATH is the same and it's correct. I'm not sure there's a problem with my jar file, Oracle JDBC driver or something else.

Just FYI:
J2SDK 1.4.0 under Windows XP
Oracle JDBC drivers (versions 8.1.7 and 9.0.1)

Andrew.
Avatar of heyhey_
heyhey_

post your CLASSPATH

Avatar of Andrei Rodionov

ASKER

C:\PROJECTS>echo %CLASSPATH%
.;C:\ORACLE\8.1.7\jdbc\lib\classes12.jar;C:\PROGRA~1\freemarker\lib\freemarker.jar
ASKER CERTIFIED SOLUTION
Avatar of heyhey_
heyhey_

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
C:\PROJECTS>echo %CLASSPATH%
.;C:\ORACLE\8.1.7\jdbc\lib\classes12.jar;C:\PROGRA~1\freemarker\lib\freemarker.jar
I see.
I've found an info how classes are found. Here is a quote: "...The JAR archive specified by the -jar option, which overrides all other values. If this option is used, all user classes come from the specified archive."

Terrible... Anyway, thanks.
Andrew.