Problems saving Fiji's preferences

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Problems saving Fiji's preferences

Christian Goosmann
Dear users and developers,
due to problems with the method java uses to determine the users home
directory Fiji-ImageJ couldn't save users preferences in some
environments that use roaming profiles. See Bugzilla Bug 187 that was
resolved two years ago.
In this resolve, a workaround permitted the user to set an environment
variable 'IJ_PREFS_DIR' that would override the path where ImageJ was to
store preferences. All the user had to do was set this variable to an
existing and writeable path.
I was really happy with that solution.
For some time now, Fiji doesn't use this method any more and I get error
messages when starting or quitting Fiji that my preferences don't get saved.
Is it possible to get the resolve of Bug 187 working again or is there a
new way to work around the old User.Home-problem now?
Best regards
Christian Goosmann

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Problems saving Fiji's preferences

dscho
Hi Christian,

On Mon, 3 Sep 2012, Christian Goosmann wrote:

> due to problems with the method java uses to determine the users home
> directory Fiji-ImageJ couldn't save users preferences in some
> environments that use roaming profiles. See Bugzilla Bug 187 that was
> resolved two years ago.
>
> In this resolve, a workaround permitted the user to set an environment
> variable 'IJ_PREFS_DIR' that would override the path where ImageJ was to
> store preferences. All the user had to do was set this variable to an
> existing and writeable path.
>
> I was really happy with that solution.
>
> For some time now, Fiji doesn't use this method any more and I get error
> messages when starting or quitting Fiji that my preferences don't get
> saved.  Is it possible to get the resolve of Bug 187 working again or is
> there a new way to work around the old User.Home-problem now?

In my test (on Linux, cannot access Windows right now, sorry!), the
following worked:

1) set the environment variable IJ_PREFS_DIR to /tmp

2) start Fiji

3) start the Script Editor by hitting '['

4) setting Language>Beanshell

5) executing the single line script 'print(ij.Prefs.getPrefsDir());'

6) verifying that the output panel of the scripting editor shows '/tmp'

7) making sure that /tmp/IJ_Prefs.txt does not exist

8) calling the single line Beanshell script in the Script Editor:

        ij.Prefs.savePreferences();

9) verifying that /tmp/IJ_Prefs.txt exists now

So: things continue to work on my side, both in a developers' version and
a clean users' version of Fiji... Could you repeat the steps above to find
out where things go wrong with your Fiji?

Thanks,
Johannes

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Problems saving Fiji's preferences

Christian Goosmann
Hi Johannes
Johannes Schindelin wrote:

> Hi Christian,
>
> On Mon, 3 Sep 2012, Christian Goosmann wrote:
>
>> due to problems with the method java uses to determine the users home
>> directory Fiji-ImageJ couldn't save users preferences in some
>> environments that use roaming profiles. See Bugzilla Bug 187 that was
>> resolved two years ago.
>>
>> In this resolve, a workaround permitted the user to set an environment
>> variable 'IJ_PREFS_DIR' that would override the path where ImageJ was to
>> store preferences. All the user had to do was set this variable to an
>> existing and writeable path.
>>
>> I was really happy with that solution.
>>
>> For some time now, Fiji doesn't use this method any more and I get error
>> messages when starting or quitting Fiji that my preferences don't get
>> saved.  Is it possible to get the resolve of Bug 187 working again or is
>> there a new way to work around the old User.Home-problem now?
> In my test (on Linux, cannot access Windows right now, sorry!), the
> following worked:
>
> 1) set the environment variable IJ_PREFS_DIR to /tmp
>
> 2) start Fiji
>
> 3) start the Script Editor by hitting '['
>
> 4) setting Language>Beanshell
>
> 5) executing the single line script 'print(ij.Prefs.getPrefsDir());'
>
> 6) verifying that the output panel of the scripting editor shows '/tmp'
>
> 7) making sure that /tmp/IJ_Prefs.txt does not exist
>
> 8) calling the single line Beanshell script in the Script Editor:
>
> ij.Prefs.savePreferences();
>
> 9) verifying that /tmp/IJ_Prefs.txt exists now
>
> So: things continue to work on my side, both in a developers' version and
> a clean users' version of Fiji... Could you repeat the steps above to find
> out where things go wrong with your Fiji?
>
> Thanks,
> Johannes
thank you for getting back so quickly and pointing me in the right
direction. I found an alternative way and now have my Fiji running
smoothly again. I started with changing the environment variable to
'C:\temp' which I guess would be the equivalent of '/tmp' on my system
and just started and closed Fiji again. In the error message that
flashed up on closing, I suddenly noticed that Fiji attempted to write
to 'C:temp' omitting the backslash after 'C:'. So I changed the
environment variable to 'C:\\fiji.app' (which exists on my computer
minus one backslash) and presto, Fiji only eats only one of the
backslashes and sets the prefDir to 'C:\fiji.app'.
Is eating the backslash expected behaviour of Java?
I also liked the trick with the Beanshell scripts you mentioned. Only
that '[' (which would be AltGr+8 on my keyboard?) didn't start anything.
I used Plugins>Scripting>BeanShell Interpreter instead which did just
what you wrote.
Thanks again and all the best,
Christian

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html