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. 回答1: 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 回答2: The easiest option for reading embedded