On Clojure (part 2)

Sat Nov 8 2008
clojure lisp scheme java swing qt nicole apple macosx sqlite

Distributing QtJambi with Clojure.

How to bundle up Clojure programs for distribution

One of the questions I’ve seen coming up a few times is how to distribute clojure programs. The obvious answer is to build executable JAR files.

A while ago I produced a simple database application for my girlfriends recruitment business, NRecruit. I developed this using Clojure on my Arch Linux based laptop, and deployed to her MacBook running OS X Leopard. The underlying database is sqlite3, but it could just as well be MySQL or anything else that is supported by JDBC. For simplicity I unzip the required JAR files in the root directory of the project and then rebundle them into a single distributable JAR following this guide.

Using QTJambi

That application is in production use right now, but there have been a number of problems with the Swing based GUI. I have been trying to address them, but I find Swing an unnecessarily painful toolkit to use.

Several years back (circa KDE 2, and early KDE 3) I used to do some development with Qt in C++ and Ruby. I have looked at Qt4 a couple of time before and I still feel that Qt is one of the nicest GUI toolkits out there. So I read this blog entry on using Qt4 with clojure with great excitement I started porting the NRecruit database UI over to Qt.

So far I’ve hit two issues. The first one (using Qt Designer files from within Clojure) I’ll address in a later post; the second one is more fundemental. Distributing QtJambi in your jar has a few gotchas. The most succesful approach I’ve found is this:

That leaves me with what I’d describe as a “statically linked” executable (it isn’t in any sense statically linked, but the effect is the same).

More later…

HTML5 and all that

Sun Jan 10 2010
frontend html clojure xml flash google_gears emacs nxml

Mac foo I learned today

Fri Mar 27 2009
apple macosx unix

On Clojure (part 7)

Tue Jan 13 2009
clojure lisp apple macosx core_data nicole