• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Eclipse Jar Bundling

 
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
 
reply
    Bookmark Topic Watch Topic
  • New Topic