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

Eclipse - jar creation

 
Travis Thomas
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
I am having trouble getting Eclipse to generate an executable jar that actually works. Here is the error I am getting:



When I create the jar, I have specified all three options: Extract required libraries into the jar, Package the required libraries into the jar, and Copy the required libraries into a nearby folder. In no case does Eclipse package the JDBC classes. It includes classes that I didn't know I used--some from org.eclipse, org.hamcrest and JUnit (even though I don't particularly want to include my test class, I can't figure out how to remove it from the jar without removing it from my project).



I've also tried creating the jar directly from the command line, but I get mainClassNotFound errors.

Thoughts?

Thanks,
Travis
 
Ogeh Ikem
Ranch Hand
Posts: 180
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried creating the executable jar through the file menu i.e. file --> export --> java --> runnable jar file
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you include the MySQL JDBC driver as one of the JAR files in your Build Path?
 
Travis Thomas
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Peter Johnson wrote:Did you include the MySQL JDBC driver as one of the JAR files in your Build Path?


This was the error. It would launch from Eclipse fine, but not externally or from the jar. Once I added the MySQL JDBC JAR to to Eclipse build path, it included it in the JAR. Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic