aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes Eclipse - jar creation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Eclipse - jar creation" Watch "Eclipse - jar creation" New topic
Author

Eclipse - jar creation

Travis Thomas
Greenhorn

Joined: Mar 31, 2011
Posts: 9
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

Joined: May 13, 2002
Posts: 180
Have you tried creating the executable jar through the file menu i.e. file --> export --> java --> runnable jar file
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5836
    
    7

Did you include the MySQL JDBC driver as one of the JAR files in your Build Path?


JBoss In Action
Travis Thomas
Greenhorn

Joined: Mar 31, 2011
Posts: 9
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Eclipse - jar creation