This week at EclipseCon I have had the pleasure of meeting Alex Buckley, Sun’s Java language supremo and spec lead for JSR 294. For those of you who do not memorise JSR numbers, 294 was originally known as “superpackages”, was killed off for a while, and is now back in the form of enhancements to the Java language to support modularity. As an OSGi supporter I have no problem in principle with JSR 294, indeed it may make the use of OSGi easier, especially for beginners learning the Java language.
However, authors of libraries and applications should not have to choose which of two module systems to support when they release their software to the world. Another Sun project named Jigsaw aims to build an alternative module system to OSGi, one which will be built into OpenJDK and available for library and application developers to use. For a large number of Java developers, the convenience of using Jigsaw is likely to trump any arguments about the technical superiority of OSGi, as OSGi must be downloaded separately. Mark Reinhold announced in his blog that Jigsaw will be fully supported by Sun, although it is not an official Java standard backed by a JSR.
Time for some commercial reality. Yes, Sun is the “mothership” (as Alex puts it) for Java right now, but Sun is unlikely still to exist in its current form by this time next year. Whether it is eaten whole by IBM or torn in half and shared between HP and Oracle, or any of the other rumoured outcomes, a promise from Sun to support Jigsaw is completely worthless. This is especially true because Jigsaw is in direct opposition to the commercial needs of all the potential acquirers. If IBM gets Java, it will kill Jigsaw, I guarantee it. Ditto Oracle. By choosing to build Jigsaw outside of a JSR and in opposition to an established industry standard, Sun has exposed its customers to substantial commercial risk.
I don’t like making the argument against Jigsaw this way. I would much rather debate the relative technical merits versus OSGi, but I feel I have already done so and the OSGi community continues to do so. However Sun intends to use its commercial power as the owners of the predominant Java distribution to force through Jigsaw irrespective of its technical merits, therefore I believe it is not inappropriate to counter with commercial arguments in addition to technical ones.
So as a Java developer interested in modularity, you now have a choice. Do you choose OSGi, an industry standard supported by an alliance of over 30 companies, two JSR numbers and over ten years’ experience? Or do you choose Jigsaw, a new proprietary platform supported by one vendor on the brink of acquisition/bankruptcy? Your job may depend on the answer.