I need a file filename.txt which is inside a jar file. How can I read the contents of the txt file using code? Are there any libraries available for working with *.jar files?
I need a file filename.txt which is inside a jar file. How can I
Share
The jar needs to be on the classpath of the application.
This code will search for the file test.txt in the root of all jars.
If you need to specify a jar that isn’t on the classpath, then the other suggestions might be more worthwhile.