File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes IDEs, Version Control and other tools and the fly likes Eclipse Jar Bundling Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Eclipse Jar Bundling" Watch "Eclipse Jar Bundling" New topic
Author

Eclipse Jar Bundling

Mark Wuest
Ranch Hand

Joined: Jun 07, 2003
Posts: 88
I have created a java project in MyEclipse that I wish to make into a standalone executable jar. It needs jdom.jar, mssqlserver.jar, and a couple of others. I can create the jar with "export->jar file", but it will not execute because, of course, it cannot find the stuff it needs in those other jars.

I cannot get Eclipse to bundle these other jars with it. Since I'm a contractor in an Eclipse shop, just making one manually with jar is out of the question.

How do I get eclipse to include these other jars?

Thanks,

Mark
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18115
    
    8

You don't get Eclipse to include those other jars. (No matter what you meant by "include".) You put their names into Class-Path entries in your executable jar file's manifest and distribute them along with (not in) your jar. Here's the jar file tutorial, it tells you that and more:

http://java.sun.com/docs/books/tutorial/deployment/jar/
Mark Wuest
Ranch Hand

Joined: Jun 07, 2003
Posts: 88
Originally posted by Paul Clapham:
You don't get Eclipse to include those other jars. (No matter what you meant by "include".) You put their names into Class-Path entries in your executable jar file's manifest and distribute them along with (not in) your jar. Here's the jar file tutorial, it tells you that and more:

http://java.sun.com/docs/books/tutorial/deployment/jar/


Heh - it's all coming back to me now ('been sequestored in servelet land for way too long!). In fact, I vaguely recall JBuilder defaulting to bundle the jars in my jar on some project once and having to do crazy classloader games.

You're right - I don't want those jars bundled in mine.

Thanks,

Mark
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Eclipse Jar Bundling
 
Similar Threads
eclipse: export tool
My jnlp didn't work with multipl jars in the ressource section
Tomcat 5.5 Class loading issues--and I have done some home work on this one
Another classpath question
Ant - How to create a runnable jar of jars and classes