eavidan
eavidan

Reputation: 5564

Changing the contents of a jar from a Java program

I would like to be able to create a program that receives a .jar file (another app I've created), and modify it's contents (only add or remove files (not class files or anything), not small modifications).

If it matters, the question in hand is about an app that has a Music library, and supports adding files to it (so that if I open it up with winrar and add music files into the music directory, the app will recognize it on startup), but I would like to save the users some time, and not have them meddle with the jar, so that is why I want to create this program (so that they configure the app music library by themselves and share it with others). There are other features except music that also support this.

Upvotes: 1

Views: 162

Answers (1)

vanje
vanje

Reputation: 10373

Use TrueVFS (the successor of TrueZIP) to access and modify the content of your JAR file as a virtual file system. With this you can change the JAR file in place without the need to extract and repackage it.

Upvotes: 1

Related Questions