/var/opinion - Is GPL Java too little, too late?

June 1st, 2007 by Nicholas Petreley in

Java is on its way to become mostly GPL but is it too late?
Your rating: None

Sorry to start with the spoiler, but the answer is, “No, it is not too late.” I would certainly have preferred that Sun GPL Java before Microsoft .NET was released. I think .NET would have been a total non-starter in that case. But allow me to present the evidence that Java is already kicking .NET keister on Linux.

Look at how pervasive Java has become even without the benefit of the GPL. SourceForge is one of the most if not the most popular repository of software projects for Linux (software is available for other operating systems, including Windows, but SourceForge is primarily a Linux repository). Java has enjoyed a highly prominent spot on SourceForge for a long time, well before Sun announced that it would GPL most of Java. At the time of this writing, SourceForge lists 5,421 projects written in Java. The number of Java projects outnumbers even C++ projects, at 4,582. Only 284 projects are listed for C# and only 34 projects for BASIC. I don't think it will surprise anyone that C outnumbers all others with 8,558 projects.

Here is what .NET brings to the table that Java lacks. The .NET API has richer functionality because it is not written to be a Write-Once-Run-Anywhere (WORA) platform. Java aims to be WORA, so it is missing some pretty basic features, such as good support for USB or FireWire. That's because direct support for hardware violates the WORA principle. You have to write hardware and/or platform-specific Java extension libraries that make use of the Java Native Interface to support these things.

Is that a bad thing? Must Java be faithful to WORA to be Java? In one sense, the answer is yes. The core JVM should be faithful to WORA. But that doesn't mean you can't extend Java to be platform-specific. Indeed, I hope compiled Java, in addition to the WORA JVM, gets even better as the community gets more involved in the future of Java. I am confident that only good will come of the community efforts.

I expect hardware-specific extensions to projects will flourish once Sun finishes its GPL-ization of Java. Java can remain a WORA platform for those who want to use it that way, and the community can provide the tools you need to use Java as a magnificent platform-specific language as well. So what if the add-ons violate WORA? It's a language, not a religion. In contrast, the Mono team is dead set on providing the non-WORA functions by playing catchup with the Windows API portion of .NET. All I can do is tip my hat and say, “good luck”.

The current problem with Java on Linux that is now going away is that it isn't usually a no-brainer to install Java on your favorite distribution. That's changing quickly, but it's still hit and miss. Worse, some of the best Java applications aren't available with a simple apt-get.

The apt-cache search jedit command turns up nothing, even on the future release of Ubuntu, even though jEdit is a spectacular Java-based editor. A search for the BitTorrent client Azureus brings up the GCJ-compiled version. There's nothing wrong with that, but I'd still prefer to run Azureus as a Java application. I have to download and install Azureus manually if I want the non-GCJ version. There aren't all that many professional-quality standalone client applications in Java, but the ones I love and use are rarely available from standard application repositories. I expect, or at least hope, that will change as the GPL-ization of Java progresses and a Java virtual machine is installed by default on all distributions of Linux.

But here's where Java stands to explode in usage. Currently, economy Web hosting supports MySQL and PHP by default, with perhaps Perl and maybe PostgreSQL. Java usually costs extra, most likely because it's not free, and the commercial hosts who provide these services didn't get Java installed by default. I'm betting that within one year, you'll see all those $5 or more per-month hosting services provide Java and JSP by default. I've even seen a few that already have taken this step. Could I be wrong? It's certainly possible. I was wrong once before—October 1979, I think, but I could be wrong about that. Regardless, I stand by my prediction that Java will explode on economy hosting services.

The bottom line is that if you haven't already taken the plunge, do so. Java isn't as easy to pick up as, say, PHP. But, it's enough like C/C++ that the learning curve won't be overly steep if you come from a traditional C/C++ background. I've found that the key to learning Java is to focus on how to use the error-handling features properly, which is generally where I tripped up when I first tried my hand at programming in Java.

Nicholas Petreley is Editor in Chief of Linux Journal and a former programmer, teacher, analyst and consultant who has been working with and writing about Linux for more than ten years.

__________________________


Special Magazine Offer -- Free Gift with Subscription
Receive a free digital copy of Linux Journal's System Administration Special Edition as well as instant online access to current and past issues. CLICK HERE for offer

Linux Journal: delivering readers the advice and inspiration they need to get the most out of their Linux systems since 1994.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Anonymous's picture

Is this Editorial for Real

On May 26th, 2007 Anonymous (not verified) says:

There are so many things wrong with this article, I don't know where to begin.

On the topic of WORA, though Java may aim for WORA, it falls short; wherever Sun or other commercial companies invest in R&D is what is supported. I don't see a rush of support for Mac OS 9, FreeBSD, or OS/2. With open source projects like Mono, it can be supported wherever the community desires to support, not at the whim of commercial companies. Additionally, many implementations, such as on HP-UX or other Unices, never quite work correctly for some APIs. In the Java community, it is often joked about WOTE (Write-Once, Test Everywhere).

When talking of platform-specific Java extension, what does he think AWT is? It has platform specific components to get it to work with GDI, Xorg, or Quartz. The argument about supporting USB or Firewire doesn't seem to hold water.

On the note of "Mono team is dead set on providing non-WORA functions by playing catchup with Windows API portion of .NET"? I'm not sure where he's coming from on this. Before to run Windows Forms, one had to use WINE, but it has been fully implement and is cross platform. Mud slinging to the Mono team is both ignorant and unsupportive of the spirit of open source and the whole bazaar concept.

He mentions that GPL-ization will solve all our problems but they can make them worse if there is no leadership in the Java community and we get tons of variant Java implementations.

In the end, he shares his struggles about Java, which sort of indicates his bias toward the Java language, and thus the Java platform. I love the concept of WORA, which is what .Net is about through ECMA standards, but I don't want to be forced or strong-armed particular language, especially IMHO a syntactically limited, gaudy or wordy language that takes pages to do small chores (ok, I'm a Perl programmer, what can I say). With .Net, you can choose your language, and inherit objects between languages on the CLR virtual machine, whereas Java VM only has mainly one language: Java.

Anonymous's picture

Yo también considero que

On July 9th, 2007 Anonymous (not verified) says:

Yo también considero que este articulo esta lleno de errores que solamente dejan al descubierto la falta de conocimiento por parte del autor acerca del proyecto MONO, de lo que es capaz de hacer MONO en la actualiad y el soporte que tiene para los diferentes SO que soporta.

MONO es una realidad y es multi plataforma eso es un hecho. El autor solamente refleja su profundo fanatismo y apego a java sin tener conocimiento de lo que critica.

En todo internet podemos ver muchos articulos como estos cuyo propósito es confundir y mal informar a los lectores acerca de los grandes esfuerzos y resultados exitosos que ha alcanzado MONO.

Mi consejo es que no se dejen llevar por el criterio de otras personas y que comprueben ustedes mismos los hechos....

Post new comment

Please note that comments may not appear immediately, so there is no need to repost your comment.
The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <pre> <ul> <ol> <li> <dl> <dt> <dd> <i> <b>
  • Lines and paragraphs break automatically.

More information about formatting options

Newsletter

Each week Linux Journal editors will tell you what's hot in the world of Linux. You will receive late breaking news, technical tips and tricks, and links to in-depth stories featured on www.linuxjournal.com.
Sign up for our Email Newsletter

Tech Tip Videos

From the Magazine

December 2009, #188

If last month's Infrastrucuture issue was too "big" for you then try on this month's Embedded issue. Find out how to use Player for programming mobile robots, build a humidity controller for your root cellar, find out how to reduce the boot time of your embedded system, and if you're new to embedded systems find out the basics that go into one. You can also read about the Beagle Board, the Mesh Potato and a spate of other interestingly named items. And along with our regular columns don't miss our new monthly column: Economy Size Geek.


Read this issue