Hey Java! Let's Talk Open Source

July 02, 2004

I'm not going to beat around the bush like Sun, let's get right to it. The time is right for open source Java. James Gosling, the father of Java and t-shirt launcher extraordinaire that we know and love, has blinders on when it comes to the adaptation of Java in the world of open source, especially on the Linux desktop. He made a claim during "The Big Question" debate at JavaOne 2004 that Java has been integrated into the Linux platform. When it comes to the deskop, he is flat wrong. Let's face it, Linux users don't use Java (we are not talking server-side). Hell, Linux users cannot even get the J2SE out of the box right now, so how can you expect someone to start developing on it?? Even if the license to ship Java with Linux was corrected, the UI still looks like crap and doesn't play nicely in the Linux sandbox of GTK2 and QT3.

As much as Sun emphasizes compatibility and fears a code fork, fragmentation is already happening, namely because the JCP isn't open source (examples include SWT and velocity). When I asked Erich Gamma about using SWT for Eclipse, he defended by saying "the JCP isn't open source, so we created a project (SWT) that was." Eclipse is great because it is open source. It is a perfect example of what Java could become if it allowed people in the door. Eclipse is by far the most popular Java desktop application on Linux, and it isn't even using core J2SE, opting for its own open source framework. The truth is, the Linux desktop ships with (virtually) no Java programs. It should be shipping with a whole assortment of them.

Update: It was just announced today that Sun pulled their API docs from jdocs.com, more evidence that closed source Java hurts the community.

Sure, during the open source debate at JavaOne there were not that many people clapping for open source Java, many applauding the status quo. I will tell you this. Most of the people that are proponents of an open source Java are NOT the ones attending the JavaOne conference. Those are the people Sun needs to get interested in Java. If anyone thought the debate favored keeping Sun the steward of Java, it was because they were preaching to the choir.

In one of the sessions at JavaOne, a speaker asked why the Java platform isn't used more in Linux, which consistently hangs on to C and C++. Perhaps the speaker should have asked why those same developers are even now choosing to move to Mono. Mono should scare Sun, not because it is better than Java or because of the breadcrumbs leading back to Microsoft, but because here you have a case where developers are transistioning from one language to another (which happens about as often as you change cars) and they are NOT using Java. Swing is ugly as hell on Linux, so you aren't going to find people choosing it when they want to get a nice screenshot up on their sourceforge.net project site (hey, Mono has GTK2). Even if GTK bindings for Swing are in the works in Java 5.0, where are the QT bindings?

Thoughout the debate there was this paranoid concern that an open Java would not be compatible, as if open source cannot follow a spec. I say that if Java was open, the community could be defining the next technologies for Java, avoiding forks like SWT and velocity. Additionally, if Java doesn't allow itself to evolve and adapt to the needs of the developers, it will become yesterday's news. As an example in the open source community, there exists exactly one Linux kernel, and it remains both compatible and stable. Sun could play the equivalent role that Linus plays, putting down a solid fist to ensure compliance. Most issues with compatibility and fragmentation come when people don't talk, not when code is open sourced.

In conclusion, the question remains, "Where is Java on the Linux desktop and what will get it there?" I respond, "If you open source the process, the apps will come."

Posted at 03:21 AM in Open Source | Permalink Icon Permalink

6 Comments from the Peanut Gallery

1 | Posted by jack on July 27, 2004 at 08:21 PM EST

SWT isn't a fork. Swing is an emulated toolkit while SWT is native. They are different animals. If SWT was an emulated toolkit, it'd be different.

2 | Posted by Dan Allen on July 28, 2004 at 12:27 AM EST

It still doesn't matter, that's just details. What it shows is that a great deal of people wanted Java to go in a particular direction (native look and feel + open source) and Sun didn't want to go there. Now, it looks disorganized to the outside world.

I think the important point that many people are missing is that Java may seem great to those of us who use it, but for those on the outside, it still looks like it is going in a hundred different directions. The tighter Sun holds on, the worse the situation gets.

3 | Posted by lemmy on August 06, 2004 at 07:58 PM EST

Sorry, it does matter. Java did not offer native widget capability (well, they had AWT but that was a pile of shit). SWT finally offers a real native widget story for Java. For example, we switched from MFC C++ to Java because of it. We'd looked at Java over the years but the GUI always held us back.

4 | Posted by Dan Allen on August 07, 2004 at 05:11 PM EST

lemmy,

I believe we are actually in agreement. I most definitely believe that SWT matters. My point is to say that Sun just refuses to see that SWT is the toolkit that developers needed all along. While a unified look across all platforms (Swing) is a neat idea and certainly applicable in certain situations, it isn't what the mainstream program developer is looking for. Popular programs must "fit in."

Additionally, SWT is open source and has been extremely successful. I believe that is proof enough that open source is the destiny of Java.

5 | Posted by Nicholas Smith on April 20, 2005 at 10:55 AM EST

SWT is not really much of an improvement over Swing. It suffers two of the same problems Swing does - it's slow and it doesn't look like a native application.

SWT applications feel sluggish (maybe due to Java more than SWT itself, when compiled on GNU java compiler eclipse feels a whole lot faster). And they don't look quiet right either. One basic elements is the Tab panels, Eclipse has these bizarre curved shaded tabs where the rest of GTK apps use GTK's tab panels (which look different).

Don't get me wrong, SWT is an improvement to running Swing on GTK but still isn't the best solution.

I personally like my apps to use the native toolkit directly. I think the right way to do cross-platform java apps is to write the back-end code (the actual application logic and data bindings) to be the same across platforms, and have the actual GUI use a native toolkit bound to java. For Linux write your front-ends in Qt and GTK directly (in Java), on mac use the Cocoa bindings. On windows I don't know what the equivalent would be, are there MFC bindings or something?

Also, build your applications using the GNU java compiler instead of sun's Java tools. (GNU's java is more portable, actually running on more platform's than Sun's java). Linux distro's could easily build your app and ship it natively with their distributions without having to worry about including Sun's Java environment along with it.

Just my 2 cents...

Nick

6 | Posted by Dan Allen on December 14, 2005 at 08:23 AM EST

I came across this concise overview of the open source Java initiative, what it entails, and why it is important. In the end, open source Java is necessary because we, the developers, need a group that protects (and improves) Java, the programming language, rather than Java, the brand.

Got Something to Say?

Comment Form
Personal Info

Remember personal info?

Body