GPL Java

by Marcus Green

In June 2006 Sun announced that it would be releasing the Java source code under the Gnu Public Licence. Java has always been freely available to download but it has come under Suns own licence. This meant it could not be freely bundled with Linux distributions and it added a slight overhead to any ideas of simply giving it away. There had been considerable debate as to what licence Sun might use and the choice of GPL caused some controversy. The key to the GPL is that anyone can give away or sell the software but the person they give away or sell it to receives the same rights, i.e. they too can sell or give the software away. Of course, actually selling free software is quite a difficult task, but the GPL does not actually forbid the commercial sale of software.

The GPL announcement was as much about a change in mindset as about the practicalities of obtaining Java. It means that in the future Java will almost certainly be bundled with every complete Linux distribution and it will be possible to give it away just about as you please. This new licence adds to the reality of portability of Java. In the past, although Java was available for free download it required a little expertise and understanding for it to be usable under Linux. I have wasted several hours of my life attempting to get Java configured to use Applets with Netscape and then Firefox under various Linux distributions and I'm a relatively expert Linux user. Previously, when a programmer was choosing a language for Linux development they might choose Perl or C/C++ because they could be safe in the knowledge it would be "available out of the box", in the future they will be able to make that assumption about Java.

Although the GPL announcement promises great things in the future the current and near term reality is a little different. Even though the announcement was over a year ago there is still no binary version of GPL Java for you to download. The source that you can download is effectively the same as Suns JDK 7 and the feature set for that is not even close to having been finalised. According to one estimate, Java 7 and thus the GPL version of Java might be available at the start of 2009. I suspect that the new features of Java 7 will be fairly minimal as Sun and the other developers will be concentrating on the work necessary for the GPL code.

On reading that you might be asking yourself why, if Sun has the source code they don't just compile it up right now and make the GPL version available as a binary download. Part of the problem is that certain parts of Java come from third parties and cannot be released under the GPL by Sun. As a result a significant amount of work has to be done to re-write these bits of code and to test and integrate them into the main Java distribution. I downloaded the openjdk source code and building it is not for the faint hearted. Under windows it appears to require Microsoft Visual Studio .NET 2003 Professional plus the Cygwin utils to create a Unix like environment. In the meantime you can download "snapshot" builds of JDK from http://download.java.net/jdk7/binaries/. It's probably an indication of just how early these builds are in that the readme.html file that ships with the snapshot is actually the same file as in JDK 6.

Despite the delay between announcement and availability of GPL binaries the use of the GPL licence changes the playing field, it sets down a market that says "Java will be everywhere". If that sounds a little unlikely it is worthwhile looking at the broader picture of the world of Java. It's tempting to think that Java is an important programming tool, but just one of many. If you treat Java as the platform itself, in the same way as people look at operating systems, Sun can spin the story in a very interesting way.

Java Everywhere

According to Jonathan Schwartz of Sun "Few folks, at least outside of Sun, understand how pervasively successful the Java platform, and the community supporting it, have been over the past decade. But Java runs on more devices than Microsoft Windows, Linux, Solaris, Symbian and the Mac combined. Nearly 4 billion devices at this point, from smart cards to consumer devices, DVD players to set top boxes, medical equipment, all the way up into the majority of the world's transactional systems and 8 out of every 10 cellphones sold. The Java platform is, already, a global standard."

Read that again, "more devices than Microsoft Windows, Linux, Solaris, Symbian and the Mac combined". Even allowing for industry hype and plenty of those machines being very low spec systems you are unlikely to program for it is still a very impressive piece of market share. Think of that if anyone tells you that C# or python is the future. The GPL announcement also makes some of the other Java players feel a little more relaxed. It is widely rumoured that IBM has more programmers working on Java than Sun, but they have always been a little nervous that Sun seemed to have control over its direction and development. Under the new GPL licence Sun will still have considerable control over Java because they will control the ability to use the name Java. Thus if you "fork the code", i.e. create a new version based on the GPL code that differs from Suns version you will be able to give it away, sell it and use it as you can any other GPL code, but you won't be able to call it Java. You will have a tough time getting people to adopt your forked version as people are used to the comfort and security of the Sun version for the last 10 years. However if push comes to shove a big organisation like IBM has a greater comfort zone with the GPL and less reliance on the goodwill of Sun.

Java may no longer be the shiny new technology but it is the entrenched standard, and is likely to remain so for a long time.