DEV Community

loading...

Discussion on: Can you create "resources" in .jar files in Java?

Collapse
baenencalin profile image
Collapse
pjotre86 profile image
pjotre86

Then I'm afraid it's not possible at all. Can't change a file which is in use...

Thread Thread
baenencalin profile image
Calin Baenen Author

Is there any way to do it if the .jar is not in use?

Thread Thread
pjotre86 profile image
pjotre86

Yes, there is. A jar is effectively just a zip file. So you can unzip it, change/add stuff and zip it again. Feels a bit hacky, but should work.

Thread Thread
baenencalin profile image
Calin Baenen Author

How do I unzip/zip a .jar file programmatically?

Thread Thread
pjotre86 profile image
Thread Thread
baenencalin profile image
Calin Baenen Author

Thank you for your help.

Forem Open with the Forem app