I'd like to know if it is possible to insert all the libraries needed inside a single jar.
Why? I have a launcher, that launches an executable jar. This launcher, downloads at runtime the bytes containing all the code.
The problem here is that this jar that I am trying to send,is quite heavy, and most of this weight is just libraries.
A nice thing to have would be to download the libs when necessary, and download the actual code (it is just a few megabytes) always at runtime.
The structure would be something like this:
So, the question is, is there a way to pack all the jars inside a single jar?
Also, how would I access those inside my program?
Thanks.
EDIT
Here is the structure:
Jar 1: My code, this includes classes that I wrote and all the resources I might use in my code (images for example). Also I'd need to have the libs needed to load Jar 2
Jar 2: All the libraries that my code uses in it's most complex functions(Instead of having guava, openJDK, ecc. all split, I'd like them to be all together in a single jar)
What I do NOT want
A solution for a single jar containing everything. I can do that with eclipse's export function. Also, it is not what I am asking for. This means that I want the exact opposite of a "fat jar".
Obviously I'd like to know how, I could build Jar 2 and how I could access the libs in it.