jQuery in Action, 2nd edition*
The moose likes JDBC and the fly likes Class not found Exception? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Class not found Exception?" Watch "Class not found Exception?" New topic
Author

Class not found Exception?

harilal ithikkat
Ranch Hand

Joined: Oct 06, 2008
Posts: 221
I have copied connector jar file to the jdk1.5\jre\lib\ext folder


SCJP 1.5
"A candle looses nothing by lighting another candle"
itechmentors.com
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3829

harilal ithikkat wrote:I have copied connector jar file to the jdk1.5\jre\lib\ext folder


That's a not a good thing to do. You should not place external jars under JDK. You can have different location for those jars. For your question, as you topic suggest program is unable to find the class (may be the driver implementation). Try placing the jar in different location and set the CLASSPATH system variable pointing to that jar (in addition to what it currently pointing to) and run your code then see what happens, if that doesn't work provide more details about your code etc..


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
harilal ithikkat
Ranch Hand

Joined: Oct 06, 2008
Posts: 221
my code is working in my system(Linux).
showing this problem when i moved to Windows.
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3829

harilal ithikkat wrote:my code is working in my system(Linux).
showing this problem when i moved to Windows.


Do you know how to set the classpath system variable in windows? Or try setting it at the time you run JVM like :

java -classapth "Your path to the jar file & the class file/any other class files your program uses" NameOftheClassFile.

See what happens.
harilal ithikkat
Ranch Hand

Joined: Oct 06, 2008
Posts: 221
Thank you Vijitha Kumara,
i will try that
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
There's a nice FAQ entry about setting the classpath.
http://faq.javaranch.com/java/HowToSetTheClasspath
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Class not found Exception?