This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Jar File Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Jar File " Watch "Jar File " New topic
Author

Jar File

Hrishikesh Hemade
Greenhorn

Joined: Mar 17, 2005
Posts: 9
I have a executable jar file which pop's up a GUI but while uploading GUI it should populate Data in a combo box with the help of MySql database but it doesn't it gives an error java.lang.ClassnotFoundException : com.mysql.jdbc.Driver, i no it's mysql driver i have downloaded it and added to classpath of System env but it still gives the exception. Even tried with giving classpath excplicitly java -classpath C:\mysql\mysql.jar -jar GUI.jar but while popuing up GUI it throws the exception.
So guy's can you help me with this.
Thank you.
James Clinton
Ranch Hand

Joined: Jun 23, 2003
Posts: 190
try using a manifest file:

Main-Class: SomeClass
Class-Path: lib/driver.jar.
James Clinton
Ranch Hand

Joined: Jun 23, 2003
Posts: 190
try using a manifest file:

Main-Class: SomeClass
Class-Path: lib/driver.jar.
Norm Radder
Ranch Hand

Joined: Aug 10, 2005
Posts: 691
    
    1
With java.exe the -classpath option is IGNORED(no error messsage!!) when you use the -jar option.
Change your commandline to NOT use the -jar option. IE use only the -classpath option and your starting class name.
 
Have you checked out Aspose?
 
subject: Jar File
 
It's not a secret anymore!