File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Jar files & JarOutputStream Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply locked New topic

Jar files & JarOutputStream

Ayad Hindi

Joined: Jun 27, 2002
Posts: 14
Hello all !!
I have written an application that is contained in a jar. The application needs to access a properties file in the jar, modify the file, and then save it back to the jar.
The problem that I am getting is that each time a save the file to the jar, it creates a brand new jar with the same name as the one I had, and therefore I loose all my .class files and manifest.
So the question is can you add new files (or modified ones) to an existing jar, using the java.util.jar package? If not, is there any other package that would allow me to do so?
Help would be much appreciated. Thanks...
Ayad Hindi
Jim Yingst

Joined: Jan 30, 2000
Posts: 18671
Please don't repeat the same post in different forums - it may waste people's time if they compose a reply for something that is already answered elsewhere. I'm closing this thread - any followups can go here.

"I'm not back." - Bill Harding, Twister
I agree. Here's the link:
subject: Jar files & JarOutputStream
It's not a secret anymore!