Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Jar File

 
Hrishikesh Hemade
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 190
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try using a manifest file:

Main-Class: SomeClass
Class-Path: lib/driver.jar.
 
James Clinton
Ranch Hand
Posts: 190
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try using a manifest file:

Main-Class: SomeClass
Class-Path: lib/driver.jar.
 
Norm Radder
Ranch Hand
Posts: 893
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic