Friday, October 22, 2010

Java and the Mac

So Apple has quietly announced that it is deprecating its support for Java on the Mac. The wording was (not uncharacteristically for situations like this) a bit vague on the details of what this means. I think two things are definite: 1) Apple will continue to support Java 6 on Snow Leopard until it reaches end of life; which I think happens when the OS after Lion is publicly released. 2) Apple will not port Java 7+ to the Mac. The main unresolved question is whether Java 6 will be supported on Lion. My guess is that it will be offered as an optional download, similar to Rosetta in Snow Leopard. Apple won't make any promises though, as they will want to have the option to drop it if it's too much effort.

As a Mac user who has been working on the Java platform for many years, this is a fairly big deal for me. I think it's an interesting event that provides a chance to examine both Java's position and Apple's plans for the Mac. People in the Mac Java community are speculating about the deeper meaning behind this move, especially when combined with Apple effectively banning Java platform applications from the new Mac App Store. So time for me to add my speculation to the noise.

Is Apple trying to force the use of their platform and tools?

No. True, Apple has made it crystal clear on numerous occasions (the Mac App store requirements are just the latest case) that they want developers targeting their OS platforms to use their development platform (Objective-C, Cocoa, Xcode). But I don't think they are deprecating Java in an attempt to force the issue. After all, Lion will come with Perl, Python and Ruby all pre-installed.

Does Apple want to kill cross-platform desktop apps?

No. I think it's true that, strategically speaking, Apple has no interest at all in cross-platform apps (outside of the browser). But along with announcing the deprecation, the latest Apple Java release also includes brand-new support for installing multiple versions of the Java platform, explicitly mentioning support for third-party versions. It's clear that Apple has no problem at all with Java running on Macs. I think they want Oracle to take it over, but I doubt they bothered to make any sort of deal with Oracle before making this move. Update: as I was drafting this, news came through that Steve Jobs has replied to a question about this, which basically confirms that he thinks Oracle should be responsible for Java on the Mac.

Then why did Apple do this?

The reason isn't that complicated: Apple no longer needs Java. If you make a list of what Steve Jobs sees as the critical objectives for Apple, it becomes immediately obvious that maintaining a Mac port of Java is not helping to advance any of them. Of course, neither does maintaining, say, Apple's port of Python. But Python takes very little effort to port and maintain. The Java port requires a team of engineers permanently dedicated to it. Also, the huge success of iOS has given Apple the confidence that their approach to working with third-party developers is working out great for everyone. The prospect of Java developers and applications abandoning the Mac is no longer remotely scary for them. Apple have decided they'd rather pay the costs of dropping Java than keep maintaining it.

But what are Apple's critical objectives?

The main theme of the "Back to the Mac" event on October 20 was the idea of moving iPad software and hardware features into the Mac, in a way that made sense for the Mac. My theory is that Apple has now oriented its entire strategy around the iPad. I think Steve Jobs probably regards the iPad has the best thing Apple has ever made. This is because the iPad provides the "purest" user experience: you hold it in your hands, rotate it, move it, directly manipulate the information you're working with via touch, and it dedicates itself to the task at hand. Of course, the iPhone has these characteristics too, but if will forever be limited by the (obviously worthwhile) trade-off of fitting in your pocket. The larger screen size of the iPad allows the touch interface to reach its full potential.

Slight diversion: in the recent financial call, Jobs said that 7" was a lousy form-factor for a tablet. You had better believe that he meant it. I will bet that Apple will never release an iPad with a different form factor. Going smaller puts to many constraints on the options for touch UI, so you end up with a bulky iPhone. Going larger would be nice, but it rapidly becomes unwieldy (the fact the iPad can be easily held and moved around is a critical part of the "experience"). The dimensions were chosen to balance the needs of video with those of e-books. Believe me, Apple chose the form-factor it did very carefully.

And yes, something else Jobs likes about the iPad is that Apple has more control over it. While many ascribe this to cynical motives, I believe Jobs honestly sees this as being good for the customer, and part of the reason for the success of iOS devices. Whether this view is correct will, in the end, be decided in the marketplace.

What is the future for the Mac?

So Apple sees the iPad as the future. But while it might be a "pure" experience, there's obviously a large number of important things that the iPad simply cannot do1. So Macs aren't going anywhere, but Jobs wants to make them more iPad-like. In the Mac event, Jobs called out what this meant: curated App Store, full screen apps, app "Launchpad", autosave/resume. What is equally interesting is what this implies they are leaving behind. During Craig Federighi's demo of Lion on the 20th, he showed the use of swipe to switch between a) full screen apps b) dashboard c) "the desktop". Perhaps I'm reading too much into this, but what today constitutes "the Mac Desktop experience" seems, in Lion, to be just another full-screen app you can switch to. A Rosetta-like box to run "the legacy stuff". I think Lion could be Apple's first step in really redesigning the Mac from first principles.

This iPad-like approach also reinforces other trends already underway. The traditional document-centric Mac app is basically dead. Most apps will be one-window, "content-centric", and abstract the filesystem completely. And they'll be made with Apple's tools. In other words, iPhoto '11 is the model. It's going to be fascinating to see how far Apple can take this. There have been people saying, literally for decades, that the fundamental desktop concept of movable, resizable, overlapping windows was the worst idea in the history of user interfaces. Will they be proven right? I have no idea. The best part is, as others have pointed out, Windows cannot easily copy what Mac OS X is doing. Greater distinction between the keyboard/pointer OS platforms will be a great thing, in my opinion.

Where does Java fit in all this?

It doesn't. Regardless of whether you think Apple's plans for the Mac are great or terrible, it's clear that heavy-weight "cross-platform platforms" like Java and Flash, which are controlled by others, could hardly be more useless to Apple. They don't interfere with Apple's plans, but they don't help them either. Java and Flash apps don't use compelling OS X technologies like Core Animation. They're completely clueless when it comes to multitouch. Apple only cares about one "cross-platform platform": the light-weight and mobile-friendly HTML5, which they can also influence.

Will Oracle Provide Java on Mac?

I'm not sure, but I think yes. The answer to this question will also answer many questions about what Oracle really has planned for Java and JavaFX. In my opinion, JavaFX has already lost the cross-platform war to HTML5 (I like JavaFX a lot, and would love Oracle to prove me wrong here). Oracle claims to be committed to developing and promoting JavaFX, so it apparently believes it can turn things around. But there's one thing I'm certain about: JavaFX cannot succeed as a credible platform without first-class support on the Mac. If Oracle is actually serious about JavaFX (which is client-side Java now) then it needs to very soon announce that it will be adding Mac as a fully supported platform, by Java 8 at the latest. Bringing Mac support online in a Java 7 update would be better. If Oracle lets Java on the Mac rot, then the death of client-side Java will be certain and final.

Where did it all go wrong for Java?

A few people have pointed out that just 10 short years ago Steve Jobs was proudly proclaiming that the Mac would be the premier platform for Java, and now after years of disinterest Apple is finally giving up on Java altogether. How times have changed. In 2000, Apple desperately needed apps on the Mac - any apps, and of course developers. Now, it's Sun/Oracle that really needs Java on the Mac, and Apple can afford to be indifferent.

Even if Oracle produces a brilliant implementation of JavaFX for the Mac, things do not look great for Java on the client. I won't make this post even longer by discussing the reasons for client Java's failure, but it's not because Apple didn't give Java a fair chance. Speaking as someone who really believed in and supported the "write once, run anywhere" ideal of Java, the fact has to be faced: the dream is well and truly finished. Where Java has failed, HTML5 has succeeded, primarily by keeping its goals modest and being ruthlessly pragmatic.

1 But I think that we haven't even scratched the surface of what the iPad is capable of. Many of its limitations are "a simple matter of software". I think iOS 4.2 is going to give a big boost to the iPad's utility, as will iOS 5 and beyond. Having said that, there'll always be some jobs that just need a mouse pointer and a keyboard.

13 comments:

Michael Foord said...

An important difference between Apple's port of Java and their Python port is that the OS is *using* the Python port. iCal (as one example) uses Python and Twisted, and Python is used in a bunch of other places as well. I guess Apple just don't *use* Java any more.

Andrew said...

I believe that the blogs feature of Mac OS X server uses Java.

Also the iTunes store is written using WebObjects, which runs on top of Java, AFAIK.

It's just that Apple doesn't use Java much on the client side.

James Katt said...

The biggest problem for JAVA on the desktop is that the only applications begin written with JAVA are developer tools. Some applications used JAVA, such as Now X. But Now X sucked.

JAVA is primarily a server platform, NOT a desktop platform.

JAVA for years has sucked as a desktop platform. On the desktop, it was only useful for developing server applications.

As such, with Apple focused on the desktop and JAVA having very little use on the desktop

Pecos Bill said...

Two rather popular apps, OpenOffice and NeoOffice, both use Java to varying degrees. I can see NeoOffice coping with a Java loss far better than OpenOffice. There are a handful of other critical apps that are written in Java that would be tragically lost so I hope someone takes on making Java work on Lion.

I signed this and suggest you do to. Even if the didn't contribute it to OpenJDK, I'd be happy if they offered it to Oracle.
Contribute the Apple JDK source to OpenJDK.
Then others are saying it's rather unlikely Apple would open it. So, hopefully, the Oracle option would happen.

Karl said...

A lot of the discussion on this topic seems to dismiss the importance of Java in the enterprise market. In developing in-house client software for multiple platforms, Java the technology. It's noteworthy that if, and only if, one leaves out the "multiple platform" requirement then .NET will usually be the answer. So basically, if Oracle doesn't want to concede the entire enterprise middleware and client market to Microsoft, they have to support cross platform desktop Java. I would be shocked if they decide to abandon the Mac (and such a move would also indicate the expense of supporting Mac is more than most people realize).

Douglas Bullard said...

Seems like most people don't care for Java on the client - that's the JRE (Java Runtime Environment). But, if you're writing Java, you've got to be running and IDE on something - and that's Java. Whether it be SWT, Swing, or JavaFX.

OS X is the development platform of choice for many top developers. We were all set to get Macs for our developers, this move probably killed it. We're still on XP, and 3 GB of RAM just won't cut it any more (still another year our for Windows 7).

I really hope Oracle makes a move here - I'd hate to see Macs become "fluff" machines again. Enterprise developers need good machines, too.

Bjorn Roche said...

This is an excellent post. I have a lot invested in Java. However, I must say I am not impressed with JavaFX. Here is my experience:

http://blog.bjornroche.com/2010/03/java-nofx-why-one-project-dropped.html

Lachlan said...

Bjorn, yeah I have no doubt that what you say is true. I think JavaFX was a good idea, but they started far too late, and therefore tried to rush it out to make up for that.

Gareth said...

They came first for Adobe Flash,
and I didn't speak up because I wasn't a Flash developer.

Then they came for Java,
and I didn't speak up because I wasn't a Java developer.

Then they came for the Kexts,
and I didn't speak up because I wasn't a kernel extension developer.

Then they came for me
and by that time no one was left to speak up.

David C Janes said...

Oh please, gareth. Hysteria of that order just makes you look foolish.

slippytoad said...

I wonder what Apple's going to do about Mobile Me then? It's developed in Java (server side of course).

Tim G said...

"HTML5" is itself a cross-platform platform, and it is far from lightweight if you consider all of the stuff built into implementations of it - HTTP stack, DOM, JS interpreter and JIT, rendering model, video hooks, plugin API, etc. So Apple might not like Java or Flash but they are not immune to the call of large NIH frameworks - when they feel that the content available in them is too valuable to miss out on. With HTML the value is obvious, with Java and Flash it's pretty clear what Apple's opinion of the available content is. I don't fault Apple for making their choices; it will continue to cost them developer mindshare but that's obviously a cost they are willing to bear.

sandhiya said...

Its highly informative. I would be visiting your blog hereafter regularly to gather valuable information. Mac Support Melbourne