I've been saying for years that Sun needs to put some money and people into writing a real Java desktop (as opposed to just giving GNOME a Java-related background image). The main reasons being that it would be useful, be a good demonstration of faith in Java, and perhaps make them finally realize that you can't develop a good library without writing serious applications and letting that experience feed back into your library development.

So I was interested to try Joplin, an iTunes-like music player. Here's how to build and run it on Mac OS (which doesn't include ant):

# cvs co ... joplin
cd joplin/src/java
JOPLIN_JARS=`ruby -e 'puts(Dir.glob("../../lib/*.jar").join(":"))'`
find . -name *.java | xargs javac -cp $JOPLIN_JARS
java -cp $JOPLIN_JARS:. joplin.Tunes4

If you try this, you'll see that it deadlocks because they haven't followed their own advice about constructing the GUI on the AWT thread. (They do in Tunes2, which otherwise looks worse.) You'll also want a patch like this so that you don't have to fight the hideous JFileChooser, and so that any of tracks are recognized. (Does the Win32 version of iTunes really append "/" to each filename?)

--- joplin/dataset/ITunesDataProvider.java 20 Jun 2005 21:34:32 -0000 1.5
+++ joplin/dataset/ITunesDataProvider.java 2 Jul 2005 18:12:05 -0000
@@ -49,7 +49,6 @@
public ITunesDataProvider() {
// this("c:\\Documents and Settings\\Richard\\My Documents\\My Music\\iTunes\\iTunes Music Library.xml");
if (libraryPath == null) {
- //TODO automatically look for the file in the default Windows location, and in the default Mac location
libraryPath = this.getDefaultPath();
if(libraryPath == null) {
//before asking
@@ -68,6 +67,10 @@
if(lib.exists()) {
return lib.getCanonicalPath();
+ lib = new File(home,"Music/iTunes/iTunes Music Library.xml");
+ if(lib.exists()) {
+ return lib.getCanonicalPath();
+ }
} catch (IOException ex) {
System.out.println("couldn't find the itunes dir directory.");
return null;
@@ -330,7 +333,7 @@

public Track(Map track) {
try {
- if (!((String)track.get("Location")).endsWith(".mp3/")) {
+ if (!((String)track.get("Location")).endsWith(".mp3")) {

It's pretty slow to start up, for reasons I can't be bothered to investigate. It doesn't seem to recognize my album art (though it did for one CD, once, and then suffered from the common Mac OS problem of BufferedImage channels being mixed up). The player's fine, though, and hardly uses any CPU. The visualizer (which I'd never use anyway) looks fine to my uncaring eyes, but it's a huge CPU hog.

The game-like cycling through the CD box images is okay, but resource-intensive, and because of that, it gets really jerky. It looks like it might be pretty neat, though, if there were one CD "avatar" per album, rather than per track, which is just silly. I have 5,000 tracks, which just isn't navigable by those means. (This is also why, when people call me an Apple fan-boy and suggest that there are good alternatives to the iPod, I just laugh. Less than 30 GiB? Here's a nickel, kid: buy yourself a proper mp3 player!)

There's definite promise, but it hasn't reached the critical mass where I'd really be interested in working on it and contributing patches myself. (Am I the only one who finds java.net really awkward? Why can't I submit a patch or post on a discussion forum without "requesting a project role"? Why add this artificial barrier to entry? Yes, you'd like people to make a commitment to your project, but if they don't feel prepared to do so, why wouldn't you still want their one-off patches?)