Must-read: Chris Adamson, one of the few developers with real experience with Java and multimedia, lays out just how bad the situation is with Java on the Mac:

I think the problems here are not insurmountable – it’s just a matter spending energy on the future of development in Java, not ranting at Steve Jobs – or simply moving on to other alternatives if they’re better-suited to your task anyway.

Chris actually knows what he’s talking about, whereas I rant into the ether in the hopes that people who know what they’re talking about set me straight.

But I am confident of one thing. As I said last week, there are two scenarios here: one, Oracle steps in with their own implementation, and two, the OpenJDK community does. Unfortunately, right now, both scenarios are seeming unlikely. Chris does a nice reality-check on just how far OpenJDK on the Mac is from doing what’s necessary. Short list:

  • The UI.
  • Sound.
  • Mac integration.

(Hint: those are not exactly minor problems.) Oh, yeah, and then there’s the fact that, as Chris puts it, “Java’s desktop packages – AWT, Swing, javax.sound, etc. – are very much a white elephant.”

Or to put it another way, “Desktop Java is a ruinously expensive legacy that they need to do something about.”

One of the reasons Processing made it to Android so quickly, by the way, is that Processing doesn’t really invest in that expensive UI legacy. Switch the output to OpenGL and move on. But that doesn’t solve the problem of getting audio to work — which Chris puts at about a $20k cost, and for a set of packages (JavaSound) with their own set of legacy problems. And doing away with UI widgets entirely isn’t a solution, either; it’s not clear what will now happen to the many applications that rely on those, like Eclipse. (Some people were predicting the demise of the Android SDK, but remember that the core SDK is all based on command-line tools. In other words – don’t panic about that.)

Chris has at least successfully dissuaded me that Apple contributing to OpenJDK is more or less legally impossible, even if they had a desire to do so. I still think a version of OpenJDK not weighed down by these issues could have a future. Too bad Oracle dominates the OpenJDK process.

Someone at Oracle realizes this is a problem, right? They’re waiting in the wings with a Java implementation for the Mac?

Bottom line is, between the Apple deprecation, decade-old political and technical problems, and Oracle going on an IP rampage with Google, it’s hard to be optimistic about Java in general. I hope that artists and creative people begin to look at other alternatives. C/C++ is there, of course, but that’s not always the right solution for everything. Python, anyone?

Side notes… In all seriousness, considering alternatives is a good idea with or without a crisis, and commenters do just that. (LuaAV is worth a look, in other words.) I think it’s reasonable to ask Oracle to do a Java implementation, and complaints should be at their doorstep, not Apple’s. Waiting for anyone is never a reasonable answer, on the other hand. Apple’s Java implementation appears to be included in 10.7 Tiger, even though it’s deprecated, so there’s some time to work on OpenJDK. Those who don’t need legacy UI widgets have a distinct advantage, and I would question Chris’ own “$20,000” sound example – because to me, porting JavaSound seems like a terrible idea. Instead, it seems Java just needs a simple callback audio I/O implementation that works, not a kitchen-sink audio library that doesn’t.

Sure enough, running on OpenJDK isn’t impossible. Eclipse + SoyLatte + Mac works. Have a look at this blog post and check the screenshot above. That means you can be reasonably sure you’re not losing your entire IDE, or the ability to make Android apps on the Mac. And with adjustment, I think it could also mean that the next major milestone of Processing could run on OpenJDK. (I’ve accidentally run Processing on OpenJDK without incident because of forgetting to switch default Java on Linux a couple of times – and was surprised when nearly everything worked. So it’s time to go see what breaks, and un-break it. What I don’t know is how much of a hit on the Mac the lack of Apple’s AWT enhancements cause. But at least Processing doesn’t use Swing.)

Eclipse on SoyLatte without X11