I am trying to access the class files packaged as a library but unfortunately the jar libraries should be packaged in another jar file.
As an example say I have a.jar that contains some class libraries. I can call (import) the classes in the jar file from my external java application. Now I need to put this a.jar inside another jar say b.jar and need to access (import) the classes in a.jar from outside of the b.jar.
You would have to write a classloader which was able to deal with "jars within jars." This sounds like a pretty bad idea to me.
Don't merge the jar files - just have them separately on disk. I realise you may need to persuade management of the necessity of having more files, but it really is going to make everything a lot simpler. Writing a classloader is non-trivial...