modify com.apple.java.util.prefs.plist at ~/Library/Preferences/

NOVELLUS
Contributor III

 

Hello to all ;)
I hope, someone can help me to find a solution for my question:
We use an app, based on Java®. There are some settings for this app configured at ~/Library/Preferences/com.apple.java.util.prefs.plist.
Now, we have to modify some settings. To do this, I wrote a small script, that works very well. The file is modified and stored with the new entries. BUT: If I start the app, the file will be reset to the old values.
I have no idea, where the "old version" comes from. I guess, that there is a backup version somewhere, maybe in a cache and a system process restores the original version of the plist.
Does anyone have an idea, how I could fix this?

1 ACCEPTED SOLUTION

NOVELLUS
Contributor III

Hello all :)

I was able to solve it by myself.
For those, who are looking for a solution for this theme, here is the trick:

It seems to be necessary to kill the plist deamon before modifying the plist file. There is a command to do this: 

 

killall cfprefsd

 

Running this command before editing the plist file is preventing from "restoring" the file to its older version.

View solution in original post

2 REPLIES 2

NOVELLUS
Contributor III

Hello all :)

I was able to solve it by myself.
For those, who are looking for a solution for this theme, here is the trick:

It seems to be necessary to kill the plist deamon before modifying the plist file. There is a command to do this: 

 

killall cfprefsd

 

Running this command before editing the plist file is preventing from "restoring" the file to its older version.

dlondon
Valued Contributor

Just wondering how you modified the plist in your script?  Was it using the defaults command?