-----BEGIN PGP SIGNED MESSAGE-----
I have one small feature request for j on Windows: it would be nice if j
would check to see if the environment variable %HOME% is set to a
directory, and if so, place the .j directory there, falling back to C:\ if
the variable is null or doesn't exist. My %HOME%, for instance, is
currently set to "C:\Documents and Settings\dan\My Documents", which is
understood by Cygwin, Emacs, and other applications (most ports from Unix).
Thanks for your continued work on j.
Dan Moniz <dnm@...> [http://www.pobox.com/~dnm/]
-----BEGIN PGP SIGNATURE-----
Version: PGP 8.0
Comment: Please see <http://www.pobox.com/~dnm/keys.html>
-----END PGP SIGNATURE-----
From: Peter Graves <peter@ar...> - 2003-07-30 10:50:52
On Wed, 30 Jul 2003 at 03:19:26 -0700, Dan Moniz wrote:
> I have one small feature request for j on Windows: it would be nice
> if j would check to see if the environment variable %HOME% is set to
> a directory, and if so, place the .j directory there, falling back to
> C:\ if the variable is null or doesn't exist. My %HOME%, for
> instance, is currently set to "C:\Documents and Settings\dan\My
> Documents", which is understood by Cygwin, Emacs, and other
> applications (most ports from Unix).
Well, I don't run Windows (let alone all of its various flavors), so
I'm not the right guy to implement (or more importantly, test) this
feature. And Java purists will tell you there's no way to read
environment variables from inside pure Java... ;)
But you can start j with the --home option and get roughly the same
java -jar j.jar --home "C:\Documents and Settings\dan\My Documents"
Or something. Maybe you need to double the backslashes, or just use
forward slashes (which I believe j understands even on Windows).
There's probably even some way you could put this in a script that
would use the %HOME% environment variable.
The --home option is documented (after a fashion) in doc/autosave.html,
"Autosave, Crash Recovery and Backups" (of all places).
In any case, it would make sense to put the .j directory in the current
user's home directory, which is available via the Java system property
"user.home". J works this way on Unix.
The reason that this isn't done on Windows is that back in 1998 or
1999, when I did run Windows, the various flavors of Java then extant
did not entirely agree on where the user's home directory was, even for
the same user on the same version of Windows. So if you ran j with one
version of Java and then later with another on the same machine, you
might end up with .j directories in two different places, which of
course screwed things up completely. I suspect this problem may be
fixed by now, but as mentioned, I no longer run Windows, so I can't
really be sure.