Hi. I’m doing the JOGL demo box where you can press a list of demo jars and have them dynamically loaded and displayed in a window.
My problem is that from inside these jars I can’t load the resources unless they are in the same dir as the JOGL demo box application.
I get my stream like this:
// Attempt load from jar file
URL fileURL = new URL("jar:file:" + jarName + "!/"+filePath);
JarURLConnection jarConnection = (JarURLConnection)fileURL.openConnection();
is = jarConnection.getInputStream();
I realise why it only works from the same path as the application that loads the jar, but I don’t know how I can get a resource from inside the dynamically loaded jar, since the classloader comes from the main application.
Anyone knows how this is done? (Simply solution please. I don’t want to open a real jar stream and sift through the entries etc. etc. if can help it. And I would’t know how to find it anyway :))
