Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Eclipse Jar Bundling

 
Mark Wuest
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • 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
 
Paul Clapham
Sheriff
Posts: 21416
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic