How to access a resource / configuration / text file in an external Jar from Java?
I am running a program in com.me.X.jar . In an external com.me.Y.jar , I have a configuration file located at ' config/conf.txt ' in the root of the Jar. How can I access this configuration file programmatically from within Java? com.me.Y.jar is not currently loaded in memory and is composed of just non-code resources. jar files are just zip files. So google for an example how to read a zip file. Or have a look at the API ZipInputStream The easiest option for reading embedded resources is to use Class.getResource or Class.getResourceAsStream I can think of several ways to achieve this,