Original URL: http://www.theregister.co.uk/2011/11/13/open_sourcing_java_five_year_anniversary/

Five years of open-source Java: Freedom isn't (quite) free

Rapture foretold: Java 8 to ascend into the Cloud

By Matt Stephens

Posted in Cloud, 13th November 2011 11:00 GMT

Open-source Java: Part One Open source Java has a long and torrid history, rife with corporate rivalry, very public fallings-out, and ideological misgivings. But has all the effort and rumpus that went into creating an officially sanctioned open JDK been worth it?

Java co-creator James Gosling certainly thinks so - although he didn't seem entirely open to the idea in the early days.

Gosling told The Reg that putting Java under the GPL has helped unify what was a fractured community while making the code freely available has helped uptake from a grassroots up.

"In general, I'd say that it's worked out extraordinarily well," Gosling tells The Reg. "Java is far stronger today than I would have predicted two years ago."

It was 13 November 2006 when Sun Microsystems bowed to sustained and long-running pressure and finally open-sourced Java under a license everybody could agree on. What did that mean?

Sun released the Java HotSpot virtual machine and compiler as free software under the GPL license; the following year Sun released the source code of the Class library under the same license.

Gosling told us: "The license was finally changed to GPL which again both unified and fractured the community - any choice that was made would have had similar issues. All of the open source licenses have their admirers and detractors. We went for the GPL because it has the strongest protections against misbehavior."

Two years after Java was delivered under the GPL we saw the first release of the Sun-led OpenJDK project for a Java Development Kit built using free and open-source code; that spawned the IcedT project lead by Red Hat, to build an even freer OpenJDK - the OpenJDK had contained a class-path exception to exempt from the GPL certain portions of the code that Sun or others still owned and open sourcers couldn't touch. A version of IcedT shipped with Fedora in 2008 that was compatible with Sun's official spec.

The open-source genie was out of the bottle, it seemed, and living up to the dream of Java becoming more compatible with open source and Linux from a license perspective - perhaps leading to easier distribution of Java with Linux and other free and open-source software. The idea was that Java could ride a new wave of development and uptake.

Today, Sun is gone and the OpenJDK project is enjoying a fresh lease of life under Sun's purchaser, Oracle. Larry Ellison's company is rolling out a multi-year roadmap for Java with OpenJDK at its core. OpenJDK - and therefore open-source Java - has also succeeded in enlisting the support of two of the industry's most influential platform stake holders: IBM and Apple.

There have been benefits, definitely, but the progression to this point hasn't been easy and while the code is free the community is only slightly freer than it was under Sun.

Before 2007 Sun had been under massive pressure to open-source Java. Java had mostly been released under the Sun Community Source License (SCSL), an open-source-like license but one that attempted to enforce compatibility on derivative works with the official spec while also ensuring Sun continued to get paid licensing on deriviative works. Both points stuck in the throats of two important groups: open sourcers and large companies using Java who were very unhappy that Sun should be in charge.

Significant among the latter was IBM, a systems and software rival to Sun which had - and continues to have - a huge market share in Java middleware and from early on resented Sun's ownership.

Ironically for a major contributor to FOSS, Sun sent out mixed signals on the open sourcing of Java. Some at the company said they had no intention of opening up Java any further than they already had, with the highly bureaucratic Java Community Process (JCP). Sun's Onno Kluyt asked in 2004: "What do you think [the open sourcing of Java] does that people can't do today?" Bruno Souza, a prominent Java evangelist in Brazil, responded with a fairly lengthy list.

Sun's then chief executive Scott McNealy in 2004, however, called "the open-source model" Sun's "friend." Gosling, meanwhile, said that not everyone was against open sourcing of Java, and the subject was a football frequently kicked about. Gosling, who claims that he converted to open-sourcing Java in 2002, indicated to Computerworld in 2003 that the debate would hit stalemate over who might end up controlling Java and how Java might fragment.

The call to open up Java outside Sun was becoming deafening, though. Virtually all the commotion was from a small number of open-source advocates while IBM was applying its own pressure. The Cathedral and the Bazaar author Eric Raymond, then president of the Open Source Initiative (OSI), called on Sun to let Java go saying it was damaging Sun's "long-term interests by throttling acceptance of the language in the open-source community, ceding the field (and probably the future) to scripting-language competitors like Python and Perl."

Pry my Technology Compatibility Kit from my cold dead fingers

Rod Smith, IBM's vice president of emerging technology, said his mighty company was wiling to work with Sun to create a process that would shepherd development of Java towards becoming open source. This would make Java "compatible" with open source and Linux, according to Smith.

With nothing forthcoming from Sun, IBM began to put its support into Apache's Harmony project in 2005, joining the project's board.

While the battle raged, however, 99 per cent of the interested parties - the cube-farm developers busy using Java to make money for their employers - just shrugged and got on with it. The parts of the ecosystem that mattered - the third-party libraries and frameworks such as Spring for example - were mostly already open. As long as the JDK itself was solid and stable, that was enough.

So it was into this universe that Java was released under the GPL in 2006 and a little later that OpenJDK was born. The announcement that Java would use the GPL should have put a sock in the mouths of FOSS advocates, except it didn't because Sun hadn't gone all the way, and had refused to open up the all-important TCK - Technology Compatibility Kit. It was a decision that still baffles many and the question of "why" will likely be eternally debated but never properly answered. To have chosen the most symbolically open of open source licenses, the GPL, and stopped short at a point where the platform could still be convincingly argued to be "closed", makes no sense - unless you examine Sun's underlying motives.

The TCK is the measure of adherence of a Java implementation to the spec. If the implementation doesn't pass the TCK then it isn't pure Java, and Sun would not grant the necessary IP to the aspiring vendor for patents that can't be technically avoided when implementing the spec. And whoever controlled the TCK predominated the Java ecosystem. One theory over why Sun clung to the TCK was because it was their money spinner, their keys to the estate: a way to keep a lid on an open box. If Sun could control the TCK, then it could control who had a Java license and who paid Sun a license fee.

Control of the TCK was a real sticking point for the Apache Software Foundation and its Harmony project - an open implementation of Java Standard Edition (Java SE). In Harmony's original FAQ page, still up on the group's website, the Apache-backed team cheerfully announced that as a non-profit, when it's time they're sure Sun will grant them access to the TCK. Best buddies and appreciative smiles all round.

The license offered by Sun (and now Oracle) for the TCK for Java SE attached restrictions on the Apache Harmony codebase, such that we would not be able to distribute Apache Harmony to users under the Apache License. Sun refused to bend to Apache's protests and in 2007 the open-source group sent an aggressively worded open letter demanding that Sun release the TCK under a license that let it deliver Harmony and in keeping with its obligations under the rules of the JCP. Sun's actions were accompanied by howls of protest from Oracle and others.

The problem for Apache were the field-of-use restrictions attached to the TCK, which say where Harmony is allowed to run to be an officially certified implementation version of Java. Apache was said it was unable to meet the restrictions, saying the restrictions would have made it impossible to distribute Harmony under an Apache license. The TCK for Harmony would have been for Java SE - for use on the desktop.

As the new owner of Java the TCK battle has passed to Oracle and the database giant's former presence in the middle of the clamour for opening of the TCK has proved somewhat embarrassing. Corporates just don't do "activist hippie" that convincingly and the company U-turned on supporting Apache on the TCK to opposing Apache.

The whole issue came to a head in late in 2010 when Apache officially withdraw its membership of the JCP as Oracle refused to give in. Apache said Oracle was doing a Sun and breaking the rules of the JCP.

It's now widely agreed, however, that Oracle's stewardship of Java has provided a much-needed shot of insulin for a platform that had been in development stasis for far too long, with Java 7 nowhere in sight. Since Oracle has been in charge, the company has quickly announced and started to deliver on roadmaps not just for Java 7 but also for its successor, Java 8. The latter is intended to put Java in the cloud. It's helped that Oracle has absorbed many Java types from Sun.

The database giant's time at the top hasn't exactly been a rosy chapter in community relations, though. In a surprise move last year IBM pulled out of Harmony, putting its muscle behind OpenJDK. Apple under Steve Jobs officially joined the OpenJDK too, while the OpenJDK itself has a proposed new set of rules for governance; the rules cement the control of IBM and Oracle over the project and Java.

One Java nation, with liberty and justice for all ... under Oracle and Big Blue

That was strike one against Apache. Strike two was Oracle's refusal to grant Harmony a TCK license, a move that saw the venerated open-source group officially storm out of the JCP.

Apache's JCP representative Geir Magnussen Jnr told us summer 2010, just before the simmering dispute came to a head: "Key to the JCP is the idea that people can independently implement the specifications and distribution license under terms that they - the implementer - choose."

He said the matter has "big ramifications" for not only Harmony, but for the Java ecosystem as a whole.

Harmony has lived on, as a core subset of the open-source Dalvik VM used in Google's fantastically popular Android smartphone platform. Oracle, though, has brought a lawsuit against Google over Android claiming it violates Java patents that it owns, with the suit sucking in Apache.

Oracle's patent infringement lawsuit against Android, under the pretext that Google is splintering the Java standard, suggests that while Java is open it's not a free process. So, too, does the fact that the JCP allowed Apache to leave standing up for its independence. Also going against free is the fact that Oracle has joint control at the top of the OpenJDK with IBM. The chairman of the OpenJDK's governing board is appointed by Oracle while the vice chair is appointed by IBM; as Forrester analyst Jeffrey Hammond has tweeted, the OpenJDK's new rules favour a duopoly between Oracle and IBM.

The bylaws new OpenJDK rules that were drafted by Oracle chief architect of the Java Platform Group Mark Reinhold with stakeholders from IBM, Eclipse and SUNY Oswego, do encourage outside participation, however. The rules speak of safeguarding "long-term health and growth of the OpenJDK Community by enabling and encouraging its members to act in an open, transparent, and meritocratic manner."

Never a truer word was said. How that pans out remains to be seen.

Oracle's actions do threaten to undermine the work and spirit of OpenJDK. If a commercial entity like Google and a non-profit open-source group like Apache can't capitalise on an open platform and take Java where they like without being sued for billions of dollars, then no amount of rhetoric will make Java "free."

Despite all these issues, OpenJDK can still become an industry success, if not an ideological one. The OpenJDK is the basis for Java SE 7. The OpenJDK will be ported to OS X (JDK 7 for OS X Preview is now available), while SAP, Red Hat and even Twitter have put their weight behind the JCP and OpenJDK project. Twitter's Chris Aniszczyk said: "We plan to contribute in the areas of performance and metrics gathering around garbage collection." Oracle, mean while, plans to extend the open-source Java stable by releasing JavaFX and incorporating it into Java 8 - a move that may just fulfil Java's prior near-misses as a rich client powerhouse.

If Oracle can loosen the reins just enough to allow companies and individuals to become active members contributing to the codebase - not just as "he who squeals loudest" members of an oligarchic steering committee - then the future could brighten up for OpenJDK.

In the meantime Java daddy Gosling - who worked briefly at Oracle just after the Sun acquisition - remains optimistic that it's the community that will keep Oracle honest. He also seems to feel Oracle itself has changed in its handling of Java and the community.

"In its latest chapter, I'm really impressed by the way that Oracle has behaved: their reputation and history are clear, and yet the strength of the community that they have to work with has kept them in line. Java is far stronger today than I would have predicted two years ago," Gosling said. ®

Additional reporting by Gavin Clarke.

Matt Stephens founded independent book publisher Fingerpress, and co-authored Design Driven Testing: Test Smarter, Not Harder.