This following URL points a jar file called bar.jar within the bar directory. jar:file:/bar/baz.jar!/ This URL points to a class with that jar file. jar:file:/bar/baz.jar!/MainClass.class I thought that logically it should be possible to access a jar within a jar with: jar:file:/bar/baz.jar!/innerJar.jar! Why do i get problems when trying to open a JarURLConnection to this url? I'm basically trying to create an executable jar which runs other executable jars which are contained within it. Any ideas people? Here are different combinations of url i tryed: jar:file:/bar/baz.jar!/innerJar.jar! error message: innerJar! not found jar:file:/bar/baz.jar!/innerJar.jar!/Manifest.mf error message: FileNotFoundException jar:file:/bar/baz.jar!/innerJar.jar this works but the JarURLConnection points to the baz.jar file and not the innerJar.jar Is is possible to access a jar with in a jar or do i need to first extract it? thanks in advance
Patrick, Yes, it is possible to nest jar files. But then in the Classpath of the Manifest of the root jar you have to specify the relative path to the inner jar files. Not sure if that answers your question, Hope this helps.