Quicksilver and Java

For reasons best known to myself I wanted to start a Java application in OS X. Now this Java application (the rather good JDarkRoom) comes as a Jar which works fine, just double click and it starts. But of course, this is where it gets a bit more complex. I want to start it in Quicksilver, the excellent launchbar for OS X, but quicksilver won’t see my Jar file. Now I’m sure I could do a workaround:

  1. You could use the Apple Developer Tools to make any Jar file a proper OS X app (I don’t really want them installed, they’ll be a temptation)
  2. You could write a plugin for Quicksilver to recognise Jar files and deal with them appropriately.
  3. You could go for a grubby hack.
I’m sure it’s easy to guess what I went for. In short, Quicksilver will run a shell script just fine so I opened up my text editor and typed:

java -jar /Applications/JDarkRoom.jar

Saved it, ran sudo chmod +x in terminal on the file I’d just saved and then put that file somewhere quicksilver can see it. Now I can just invoke the script and it’s all happy. Or something like that.

p.s. this is what happens now that I work on a Mac again and don’t have my handy copy of Tomboy available to be my personal wiki for remembering this kind of thing.