I don’t know how many other people get this issue, but it comes up at my work a bit: Some co-worker asks me if I know of a tool to do such-and-such, and invariably I think “well, that’s easy to do on Unix, but on Windows…”.
Then I remember Cygwin, and quickly find a Cygwin utility that does it, or can be scripted to do it with a small amount of work. So then co-worker asks if they can have a copy of this utility, and of course Cygwin is Free, so I say “sure, go download from www.cygwin.com.” Then they say, “yeah, but I don’t want to install all of Cygwin, can’t you just give me that one program?”
Well, the Cygwin command-line tools can be run from a Windows
CMD.EXE shell, so this is quite possible to do. However, they all require the Cygwin POSIX layer, which at a minimum means I should also give them
cygwin1.dll. But what other DLLs might the program use?
MJL2008-09-10T14:37+1000 Update: since this page gets a lot of hits, here’s the quick answer: use cygcheck, i.e:
Find it under Happy hacker discovery #2. Keep reading if you’re bored…
It is useful to have different versions of the JVM installed, for a number of reasons:
- Different optimisation features from different JVM implementations
- Different language features from different JVM versions
- Java classes compiled with “Tiger” won’t run in “Mantis”…
It is also useful to be able to quickly switch between installed JREs/JDKs depending on the task at hand.
If I’m hacking in Linux, the JPackage project provides a much nicer solution to this problem, and the Linux distro’ I’m using (SUSE 10.0) uses JPackage. It’d be nice if there was an
update-alternatives for Cygwin, but since there isn’t I’ve come up with this hack.
When you first install cygwin and run bash, it’ll usually display this error message:
Your group is currently "mkpasswd". This indicates that
the /etc/passwd (and possibly /etc/group) files should be rebuilt.
See the man pages for mkpasswd and mkgroup then, for example, run
mkpasswd -l [-d] > /etc/passwd
mkgroup -l [-d] > /etc/group
Note that the -d switch is necessary for domain users.
While I’m on the subject of Cygwin hacking, I discovered this man-page about the Cygwin X server: type
man XWinrc and read about how you can hack your systray icon to include a little launcher menu for you favorite X clients 8)
I don’t know why I haven’t ever got around to this, but here—finally—is a hack to have Cygwin only ever start one instance of emacs (especially important in cygwin, because Win32 does not appear to share program texts between processes… )