Arsene
Arsene

Reputation: 1067

Apache Commons Configuration: Save properties file within a jar

All the apologies for disturbing you. I have an issue with the apache commons configuration. I have a properties file that is located at the src folder of an application I am building (with Eclipse). When I run the app and trying saving into the properties file from eclipse it works. However when I export it as a jar and try saving into the file when I run it from CLI I get the following error:

Could not save to URL rsrc:smpp-config.properties and trace shows: ava.net.UnknowServiceException: protocol does not support output.

Please help.

Thanks

Upvotes: 0

Views: 1411

Answers (1)

Arun P Johny
Arun P Johny

Reputation: 388436

You cannot modify a file inside a jar file.

The only solution is to unzip the jar file using ZipFile and then modify the file.

Also refer the following question dealing with the same issue
Modifying a file inside a jar
Change file in jar

Upvotes: 1

Related Questions