adeeb alexander wrote:Thanks a lot for replying. The application just stores the info in text file. Suppose i want to use the application on other system. Then i should even copy the text file. N there will be not enough security. N also if user forget to copy the text file, n just take the jar n start to use on other system, he will miss tht previous info. Is there any way to achieve ma requirement.
N?
Anyway those are all pretty lame excuses. Especially the one about security, since the file is just as easily seen in the jar as in somebody's directory. And the one about where the user forgot to copy over the configuration? Not hard to fix that, really. Copy it over when you find out you forgot.
You could of course put something in place where when the user modifies the configuration, you do this:
(1) Create a new copy of the jar file containing the new configuration and everything else which was in the original jar.
(2) Terminate the application.
(3) Delete the old jar and rename the new jar to be the old jar.
(4) Start the application again.
Of course that would be inconvenient (as I said already), but if you really wanted to do that instead of doing it the simple and straightforward way, then yes, you could certainly do that.
It's worth mentioning that most -- almost all -- applications don't preserve the old configuration when they are reinstalled on a new system, and in a lot of cases you wouldn't want to do that.