So, I'm working on a Java application and I'd like to package resources into jar files to make them more portable. These jar files would be separate from the application and would only contain assets (images, sounds, save files, etc).
What's the simplest way to access arbitrary resources from inside a jar file like this? I've looked around a bit, but haven't been able to find any simple tutorials. I know that I can retrieve input streams from a Jar file with a ClassLoader but how do I get a ClassLoader that references the correct Jar?
Also, how can I programmatically bundle a bunch of resources into such a jar file? If I can get this working the way I want, I'd like to use it for a bunch of stuff, and would like to be able to dynamically create any needed archives.