you must write the file contained in the bank.
It's impossible. You basically need to get the full path to the disk file system in a JAR file, extract it using a JarInputStream (a JAR is basically a ZIP file that follows a specific folder structure and receives special Java processing), edit / add the file to the extracted folder structure and then pack it again using JarOutputStream . You may need to reload it later with the (custom) ClassLoader if you need modified JAR content later at runtime.
This, however, is quite complicated and does not make sense. As a completely different alternative, do not try to change the JAR, but simply store the data somewhere else, for example. in a fixed place in the disk file system or in the database or as a preference for the user / system, etc. Which way to choose depends on the specific functional requirement, which is not clear from the question.
source share