aspose file tools
The moose likes Java in General and the fly likes How do i edit a properties file in a jar Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "How do i edit a properties file in a jar" Watch "How do i edit a properties file in a jar" New topic
Author

How do i edit a properties file in a jar

Anil Verghese
Ranch Hand

Joined: Oct 11, 2006
Posts: 155
Hi,

Is there a way to edit properties file in an executable jar file.

Thanks
Anil
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6592
    
    1

Why is the properties file inside the JAR ? It should be located outside the jar.

You can do this with winzip or winrar. Are you looking for a programmatic solution ?


SCJP 6 articles - SCJP 5/6 mock exams - SCJP Mocks - SCJP 5 Mock exam (Word document ) - SCJP 5 Mock exam in Java.Inquisition format
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19216

Not while you are executing code from that JAR; the file system (at least Windows) locks the file so you can't modify it anymore. That's why using resources is not the way to go when you need to write to it. Use a file in the folder returned by System.getProperty("user.home") instead.


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: How do i edit a properties file in a jar
 
Similar Threads
how to update a property file?
Properties file
Apache web server
Unable to view Spring Documentaion in Eclipse 3.4.2
problem finding resouircebundle?