Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jdbc not connecting when jar double-clicked

 
Chris Dancy
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So im not sure whats going on here. Im writing a project which in turn is an executable jar. It connects to a mysql server running wherever. So when i package the project everything goes according to plan...or so you think it does. When running the project from command line java -jar myproject.jar everything works great and the database gets loaded as well. Yet when i navigate to that folder graphically and double click the executable jar it wont load the JDBC. Im not sure why this is, that it will do it through the command line but not through double-clicking. here is the manifest file i created if this helps any:

Manifest-Version: 1.0
Main-Class: profileCreator/Main
Class-Path: mysql/mysqlConnector.jar

any help in this matter is greatly appreciated.
Sincerely,
Chris Dancy
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34178
340
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Chris Dancy:
double click the executable jar it wont load the JDBC.

Can you elaborate on this? What happens? Class not found, etc?
 
Paul Clapham
Sheriff
Pie
Posts: 20945
31
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Class-Path: mysql/mysqlConnector.jar
This means that if your executable jar file is in directory X, then the mysqlConnector.jar file must be in directory X/mysql. If that's not the case, then you will be having problems with not being able to find the driver class.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic