alanwilliamson
This week at LinuxWorld Laurie Tolson gave reporters an update on the planned release of Java and its associated tools under an open source license. By the end of the year, javac and the hot spot compiler will be released. The precise license details haven't yet been announced yet - that is the part of the equation they are wrestling with the most since there are components within the JDK that aren't theirs to open source. Politics and licenses aside, let us look at what this means for the humble Java developer, the troops in the trenches churning out code daily.
The first and natural concern is of course the dreading forking. Forking is when two people make two different changes to the same code base resulting in an incompatibility with one another. This scenario is Java armageddon - the one we all fear the most. We have a small taste of this already when writing code for different versions of the JDK, but if you are careful and not always use the cutting edge API's then you're code will still happily run on legacy JVMs. A good rule of thumb is to write for at least 2 versions behind the current release. So with 1.6 about to make an appearance, you can safely play with the new tools with the 1.4 API. Naturally this depends on your own application environment so its not a hard and fast rule by any stretch.
Another area where you may already be maintaining different code bases depending on the production system is with Microsoft J#. Microsoft only got the rights up to Java 1.1 and if you code your Java application to that 1.1 API, then code will happily run on both the Microsoft .net and Java JVM runtimes. So writing for different target systems is something developers have been use to for many years now, so should we be worried about the dreaded fork?
The problems faced so far by developers have largely been down to API changes, relying on methods/classes that may or may not exist on the production system. These are relatively easy to spot with a good development environment. For example, you can easily tell Eclipse to compile for only 1.4 with it doing all the checking to make sure you haven't lapsed into a 1.5 call. But forking here could be more sinister than simple API misalignment. What if you call a method and it does something completely different than you expect?
Sadly this isn't anything new to someone who has been coding Enterprise applications that are designed to run over a wide range of application servers. Sure there is a standard JavaEE API that exists, but that is no assurance that your application will run fine on all application servers, as the interpretation of some of the API calls is down to the owner of the application server. Even the standard, relatively small, Servlet API can produce many different results depending on the servlet container.
By forking the underlying JVM we now have a much greater potential for code to either not work or behave differently. We are putting more responsibility onto the Java developer to either target a given runtime and code exclusively for that, or even worse, forcing them to test with different runtimes across different platforms. Their job could get a whole lot messier.
We already have different runtimes available to us though, with BEA JRockit and IBM's runtime and these problems don't seem to have raised their ugly head. The difference here is that these companies had to license the technology from Sun and be made to pass a stringent certification process before launching to the public at large. In an open source world this certification restriction wouldn't be there. People could easily hack the JDK to do something different and have no requirements to meet any test criteria. They could simply use it as is.

A possible way around this would be to have Sun release the certification tools so other implementations of the JDK could be tested against it. This may not necessarily test any new functionality that a developer added to the JDK, but it would make sure they didn't break anything that was suppose to work in the process. This is far more important for wide acceptance.
Okay, so let us look at this from a point of view of hope.
What benefits can the developer get from an open source Java? Take a look at the JDK bug parade. Take a look at the Top25 bugs. Here is the biggest gain for the developer.
Some of the Top25 date back as far as 1999. That is nearly 7 years a request/bug has sat there. In an open source world, the 130 odd people that have voted to have low-level network support within Java could now potentially build it themselves and contribute it back to the core branch for potential inclusion. At the moment, they have to wait until Sun dedicates coding resources to it. It is obviously clear that Sun hasn't found the time in the last 7 years to address some of these! Time to let someone else try.
There are many small bugs floating around that the community could easily tackle. Many of the bugs/features are pure Java implementations with no native code required. This opens up the potential number of contributors even further. There could be a huge development boost to the community with a much faster release cycle.
Sun has to manage this carefully. If they can be shown to be responsible stewards of the code allowing contributions from others then the reason to fork the JVM will not be as great. Why should you create your own JVM if your change can be incorporated into the main release and made available to you. If you are that desparate for it and can't wait for a release, you can use the latest build from SVN/CVS. Naturally I do not see Sun being the only committer on Java, they would merely be a member of a large group of committers.
On the whole I support the open sourcing of Java and its associated tools. Sun is right to take this slowly and consult with all parties. They only get one shot at this and once the genie is out of the bottle, it won't be wanting to go back in.
Another area where you may already be maintaining different code bases depending on the production system is with Microsoft J#. Microsoft only got the rights up to Java 1.1 and if you code your Java application to that 1.1 API, then code will happily run on both the Microsoft .net and Java JVM runtimes. So writing for different target systems is something developers have been use to for many years now, so should we be worried about the dreaded fork?
The problems faced so far by developers have largely been down to API changes, relying on methods/classes that may or may not exist on the production system. These are relatively easy to spot with a good development environment. For example, you can easily tell Eclipse to compile for only 1.4 with it doing all the checking to make sure you haven't lapsed into a 1.5 call. But forking here could be more sinister than simple API misalignment. What if you call a method and it does something completely different than you expect?
Sadly this isn't anything new to someone who has been coding Enterprise applications that are designed to run over a wide range of application servers. Sure there is a standard JavaEE API that exists, but that is no assurance that your application will run fine on all application servers, as the interpretation of some of the API calls is down to the owner of the application server. Even the standard, relatively small, Servlet API can produce many different results depending on the servlet container.
By forking the underlying JVM we now have a much greater potential for code to either not work or behave differently. We are putting more responsibility onto the Java developer to either target a given runtime and code exclusively for that, or even worse, forcing them to test with different runtimes across different platforms. Their job could get a whole lot messier.
We already have different runtimes available to us though, with BEA JRockit and IBM's runtime and these problems don't seem to have raised their ugly head. The difference here is that these companies had to license the technology from Sun and be made to pass a stringent certification process before launching to the public at large. In an open source world this certification restriction wouldn't be there. People could easily hack the JDK to do something different and have no requirements to meet any test criteria. They could simply use it as is.

Okay, so let us look at this from a point of view of hope.
What benefits can the developer get from an open source Java? Take a look at the JDK bug parade. Take a look at the Top25 bugs. Here is the biggest gain for the developer.
Some of the Top25 date back as far as 1999. That is nearly 7 years a request/bug has sat there. In an open source world, the 130 odd people that have voted to have low-level network support within Java could now potentially build it themselves and contribute it back to the core branch for potential inclusion. At the moment, they have to wait until Sun dedicates coding resources to it. It is obviously clear that Sun hasn't found the time in the last 7 years to address some of these! Time to let someone else try.
There are many small bugs floating around that the community could easily tackle. Many of the bugs/features are pure Java implementations with no native code required. This opens up the potential number of contributors even further. There could be a huge development boost to the community with a much faster release cycle.
Sun has to manage this carefully. If they can be shown to be responsible stewards of the code allowing contributions from others then the reason to fork the JVM will not be as great. Why should you create your own JVM if your change can be incorporated into the main release and made available to you. If you are that desparate for it and can't wait for a release, you can use the latest build from SVN/CVS. Naturally I do not see Sun being the only committer on Java, they would merely be a member of a large group of committers.
On the whole I support the open sourcing of Java and its associated tools. Sun is right to take this slowly and consult with all parties. They only get one shot at this and once the genie is out of the bottle, it won't be wanting to go back in.
Comments
please note, all comments will be moderated for spam and abuse before being publicly posted.
Article Details
- Published:
8:08 AM GMT, Thursday, 17 August 2006 - Categories:
Technical Commentary - Tags:
java open source harmony - Comments:
9 left; add comment
Related Articles
Article Archives


I really see no need to further open the source of the J SE/JRE/JDK. I just dont believe that vast majority of the developer community has either the time, interest, or commmitment to contribute back into that source pool.
Frankly the risk to the platform's compatibility is too great. Sun should focus on opening the licensing to enable greater unbiquity of the runtimes, and to better enabling the bug resolution process. Those in the open source community can satisfy their needs developing packages outside the java.* and javax.* namespaces to their hearts content can they not? In fact I would argue that Java is probably already the #1 platform on which to innovate in the open source community ... so do we really need to innovate 'in it? I say leave well aloneIsn't the current 'forking', with the Open Source Java implementations like GCJ, far worse than the sort of forking you're talking about?
I don't see how Open Sourcing Sun's Java implementation will worsen the situation. If (as you claim) there is a danger of forking, then if anything it will lessen that danger. But I also agree with the previous poster: Open Source does not usually imply forking, and when it does, it's usually for good reasons.Sun be better safe than sorry
Hi Steve,
All good questions and comments. From my understanding Sun was never intending to provide a one size fits all VM. Instead they were looking for third party vendors to pick up the ball and provide machine specific functionality. If you look at the specifications you can see that there is quite a bit of wiggle room for implementors to drop in specific functionalities. But there is a catch and that catch is WORA. Using an API that was specific to a laptop on a server environment would most likely break WORA unless it was done with the up most care. But this is just one point, the other point being who gets to commit code. In this regard how Sun is handling things is not much different than how any open source project handles it. You've got to be a member of the club and know the secret handshake or your code won't see the light of day. And that my friend.... is a good thing! -- KirkKirk,
If Java in Suns hands is so wonderful, Why is there an apache project, http-client that exists purely to provide an client side implementation of http that works, that understands about mime types, http error codes and cookies. Why is proxy support in Java so awful and inflexible except on the Apple port? Why is there no power management API in J2SE, to let us know when the laptop is about to be shut down or just resumed, or when the network state changes. Sun have a limited set of engineers, and have to prioritise. And, because they are trying to compete head to head with HP and Dell, they cant afford that many engineers. Things that dont matter seem to include making java work properly on laptops, or fixing http client support. That is where OSS can help; where developers can contribute to fix bits of the system that are currently broken.Forking is a fake language. We have open source implementations of zillions other succesful programming languages, including C, C++, Ada, Fortran. Things has been put under control, using those means that industry has been using for decades to handle this kind of situations: internation standards. But even for languages where those standards do not exists, PHP, Perl, Python, i don't see any fork going on ....
Sun should be able to do as they please with their property. I just hope their not making a hasty decision based on a false perception (in my opinion) that the majority of developers want open source Java.
I agree with Kirk and would like to add that the benefits of opensource are often over hyped while the drawbacks are over looked. The super star of open source is linux. Do we really want semi compatible Java distros floating around? I'm honestly not sure how likely this is to happen but at least as closed source I know it wouldn't or at least it wouldn't be easy. Over the years I've read far too many posts about people wanting this removed or that added. It pains me to think of the compatibility nightmare that this could create. Rob AbbeIt is my opinion that Java is about as close to open source as it needs to be. We have complete access to the source and we the ability to contribute bug fixes back to Sun. Have all offers of bug fixes been accepted? I can't say for sure but most likely not. One has to remember that some bugs are the result of competing concerns. Other fixes may break something else. There are plenty of reasons to reject a bug fix.
It for reasons of quality that we have committers in the open source world. You just don't get to walk in off the street and start committing code to TomCat or any other OSS project. So with Java we see that the to be a committer you must work for Sun. Points are; - Sun has been an exceptional steward of Java. They have prevented MS from forking when forking would have been a bigger problem then it is today. - I have as much access to Java as I do to any open source project. As much respect as I have for Simon Phipps and others internal to Sun that are pushing to OSS Java, I think they are maybe a bit too purist in their ideas on forking and governance. Simon makes many excelent points as to why forks should fail although I can't find fault with them, I keep looking at the 900 pound gorillias (pleural on purpose) that may have different designs that preclude them from following the expected line of thinking. Kirk PepperdineDo you think this will have any effect on the Harmony project or will the drive behind it still exist despite these changes?