Login  Register

user.home Error in Prefs

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options Options
Embed post
Permalink
Reply | Threaded
Open this post in threaded view
| More
Print post
Permalink

user.home Error in Prefs

Grant Harris
I've run into this problem a couple of times on Windows 7;  
I get an error finding and saving IJPrefs...
Because IJPrefs is now put in the user's directory (rather than ImageJ's dir)
is seems that we've run into a "long outstanding bug in Java": http://bugs.sun.com/view_bug.do?bug_id=4787931
There are situations where System.getProperty("user.home") gives the wrong directory, so I guess that Prefs#load() fails.  It looks as though getting the user.home directory can reliably be gotten this way:
                       
javax.swing.filechooser.FileSystemView.getFileSystemView().getDefaultDirectory();

-- Grant

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