2

i am doing a java library that is using jaybird jar. I want my library to be a jar with the jaybird in it so when I have to use it, I only import my jar.

How can this be done? I'm using Eclipse Version: Indigo Service Release 2.

Thanks in advance!

J. Arenas
  • 493
  • 1
  • 9
  • 23

1 Answers1

2

It can be done, but requires a special launcher using a specific classloader to extract the inner jar from the outer jar.

I would simply use the standard way of doing: deliver both jars, along with a startup .bat/.sh file used to start the application, the whole being packed into a simple zip file.

JB Nizet
  • 678,734
  • 91
  • 1,224
  • 1,255
  • I don't want it to be runnable, just to be a library with some functions to use in another project, but your idea of delivering both jars should work if in the target project I import the two jars. I'll give it a try, if it works I'll mark this as the answer – J. Arenas Dec 15 '12 at 12:29
  • Then simply deliver both jars, and let the users of your library know that your jar depends on the other one, and that both must be in the classpath. – JB Nizet Dec 15 '12 at 12:32
  • This comment is off-topic, but you might look into the concept of user-defined libraries in Eclipse as a way of being able to share build path setups easily between projects within the same workspace. – Clive van Hilten Dec 15 '12 at 13:41