Tuesday, 22 December 2009

Making Enclojure Respect My Authoritah

I discovered yesterday that Enclojure does not respect the netbeans_default_userdir setting I have defined in %NETBEANS_HOME%/etc/netbeans.conf. This was a problem because I have a roaming profile with limited space for files. I keep my NetBeans profiles on a non-networked directory so that I don't run out of space.

In order to force Enclojure to use the same directory I had to create a little batch file to override my USERPROFILE environment variable, like so:

Problem solved.

Update 1: I hit a problem with this hack. Whenever I tried to open a file dialog in NetBeans I got an IOException with the error message: "Could not get shell folder ID list". After a bit of digging around on Google I came across this bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6544857. Some discussions about it suggested it was something to do with the Documents directory being missing. I was able to resolve the problem by copying the contents of my actual %USERPROFILE% directory onto the C: drive, then updating the script to point at the mock profile directory. File choosers now work again. There must be something in the profile directory that Java is using to open a file dialog.

No comments:

Post a Comment