Forum Controls
Spotlight Features

The Rich Engineering Heritage Behind Dependency Injection

Andrew McVeigh takes us on a tour of the rich heritage behind dependency injection, what it represents, and tells us why its here to stay.

NetBeans 6: Matisse Updates

NetBeans 6 delivers great updates to the Matisse GUI builder. Spend a few minutes with Roman Strobl and get an expert briefing on what's new and what has changed.

Introduction to Groovy Part 3

In this, the third and final installation of Andres' Introduction to Groovy series, you learn about how Groovy handles variable numbers of arguments, named parameters, currying, and more about Groovy operators. Including, some new operators.

Easier Custom Components with Swing Fuse

Swing Fuse (actually just Fuse), is a framework designed to make it easier to create your own custom desktop components. In this article, Daniel Spiewak shows you how to get started and provides sample source code you can download.

Benchmark Analysis: Guice vs Spring

Willam Louth shows how he uses JXInsight Probes to investigate probable performance issues with code bases that he is not familiar with. He also highlights possible pitfalls in creating a benchmark, as well as in the analysis of results.
Replies: 142 - Pages: 10   [ 1 2 3 4 5 6 7 8 9 10 | Next ]
  Click to reply to this thread Reply

Desktop Java and Desktop Linux: A Match Made in Heaven?

At 10:17 AM on Mar 7, 2007, Michael Urban wrote:

Although the .NET vs. Java war is basically over for control of the Windows desktop, where .NET is sure to become the managed language of choice for new Windows desktop applications, there is a new battle brewing. That battle is for the Linux desktop. Now that Java has been open sourced under the GPL, even the most strict of the "free software only" distributions can start bundling it and integrating it into their Linux distributions out of the box. Indeed, many of them already have. In addition, the more ardent GPL supporters who have traditionally shunned Java can now embrace it as a first class citizen of the OSS world. Besides licensing Java under the GPL, The Swing team at Sun has also been hard at work improving the look and feel on the Linux desktop in Java 6. Take a look at the following two screen shots. One is the actual calculator from GNOME, and the other is a mock up I did in Swing using Netbeans and Matisse. Can you tell which is which?



The one on the right is the one done in Swing. It's pretty hard to tell the difference though isn't it? Swing now picks up the colors and widget styles that GNOME is using. Even if Swing isn't a Linux developer's cup of tea, there is no shortage of other toolkits to choose from for Java on Linux. Of course, there is SWT, which binds GTK natively. In addition, there are Java bindings for most popular toolkits in use on Linux including GTK and Qt.

GPL Java could not have come at a better time to make a run at the Linux desktop, thanks in part to Microsoft releasing Vista. Whatever one's feeling about Microsoft, they are often a trend setter. So far, when it comes to moving away from harder to work with, bug prone, and security hazardous languages like C and C++ for desktop application development, Microsoft has been ahead of the game. The shift away from C++ to Visual Basic was the start of the trend, but with Vista, and Microsoft's movement towards "All new desktop applications should be written as managed code in .NET", the ante is now significantly higher. Developers in the world of Windows desktop applications are now being encouraged to write their new applications in managed .NET code that makes their lives easier and less error prone, as well as avoids major causes of security holes like buffer overflows. Linux desktop programmers, however, are still doing most of their work in C or C++, where they are still managing memory by hand, still getting routine segmentation faults because of memory management problems, and still dealing with the security hassles of C and C++. The time is definitely ripe for a change in the way developers write desktop applications for the Linux platform. In fact, that change is long overdue.

If Linux desktop application developers are going to make the transition to more productive managed languages, like Windows developers are doing, there are only two real platform choices they have: The Novell sponsored Mono project, or Java.

To me, Java seems like a much more solid choice for several reasons. For one, it has a substantial head start on Mono, with over five more years of development behind it than Mono. Java is already a very stable and mature platform, where as Mono is still evolving quite rapidly. Also, Java has a vast collection of open source tools and libraries available to help with just about any type of development that one might want to do--something that Mono can't even begin to match yet. Furthermore, Java has a much larger development community in place already, and remains the most popular language for open source projects on SourceForge, as well as on FreshMeat.net, where Java has 5383 projects compared to only 284 for C#--making Java nearly 19 times more popular than C#. And finally, Mono is doomed to always lag behind the official .NET implementation due to the fact that Microsoft's actual implementation is completely closed source. Now that Java is open source under the GPL, the open source GPL version will always be up to date, since it will be the "official" implementation. Mono also has a hidden licensing trap that Java does not. Because the class libraries are licensed under the MIT license, which has virtually no restrictions on what can be done with the software, companies can conceivably patent their improvements or modifications on the libraries and then enforce those patents on anyone else making use of of the improvements or modifications. There is an interesting article on NewsForge about this problem. It's a little old, but still good reading.

OK, granted I may be a bit biased in favor of Java. But I think my above points were at least reasonably objective as to why Java makes the best choice for the future of the Linux desktop. With the open sourcing of Java under the GPL, Sun has removed that final barrier to entry, since all of the performance, or "it doesn't look native" arguments are no longer valid.

And finally, both Linux and Java benefit from using Java on the Linux desktop, since both of them want the same thing, and can mutually contribute towards the same goal. Both Linux and Java want greater desktop market share. Java can give this to Linux by providing a more productive, more secure, and easier to debug platform for writing applications, as well a platform so that applications written in it can also run on Windows. This helps protect the developer's investment in a minority platform when it comes to the desktop. And Linux has something to offer Java as well: a second chance at becoming a major player in the desktop application arena. Linux is slowly but surely gaining desktop market share. Java can help it grow, and also grow with it. It could be that desktop Java and desktop Linux are a match made in heaven.

What's your opinion?
1 . At 10:28 AM on Mar 7, 2007, Jacek wrote:
  Click to reply to this thread Reply

Re: Desktop Java and Desktop Linux: A Match Made in Heaven?

Have you tried running a Swing app under KDE (which IMHO is far superior to GNOME)?

It is nothing short of abysmal (even with the GTK-Qt themese installed that uses Qt to give GNOME apps a KDE-like look and feel). It does not even pick up the font sizes correctly. And the text anti-aliasing seems noticeably weaker than native apps. This is with JDK 6.0. Pretty sad state of affairs for now.
2 . At 10:38 AM on Mar 7, 2007, Michael Urban wrote:
  Click to reply to this thread Reply

Re: Desktop Java and Desktop Linux: A Match Made in Heaven?

> Have you tried running a Swing app under KDE (which IMHO
> is far superior to GNOME)?

Yes, it does need some work on KDE, although I am GNOME user myself where it is basically impossible to tell the difference between a native app and a Swing app.

However there are two options for writing KDE applications in Java as well. The first is a third party look and feel. There is at least one project I know of that is working on producing a look and feel that integrates well with KDE.

And besides that, as I mentioned, there are other toolkits available--including a direct Qt binding for Java.
3 . At 11:32 AM on Mar 7, 2007, Speedo Goo wrote:
  Click to reply to this thread Reply

Re: Desktop Java and Desktop Linux: A Match Made in Heaven?

"Although the .NET vs. Java war is basically over for control of the Windows desktop"

Are you sure?
4 . At 11:52 AM on Mar 7, 2007, Andy Tripp DeveloperZone Top 100 wrote:
  Click to reply to this thread Reply

Re: Desktop Java and Desktop Linux: A Match Made in Heaven?

> Although the .NET vs. Java war is basically over for
> control of the Windows desktop, where .NET is sure to
> become the managed language of choice for new Windows
> desktop applications,

I find it strange that a "war" can be "over", because one side is "sure to win". It may be "predetermined" or something like that, but not "over".

> there is a new battle brewing.
> That battle is for the Linux desktop. Now that Java
> has been open sourced under the GPL, even the most
> strict of the "free software only" distributions can
> start bundling it and integrating it into their Linux
> distributions out of the box.

Yes, and of course, they also could do that at any time with the JRL.

> Indeed, many of them
> already have.

Yes, they have, even though Java is not yet actually open-sourced.

> In addition, the more ardent GPL
> supporters who have traditionally shunned Java can
> now embrace it as a first class citizen of the OSS
> world.

The ardent GPL supporters *can*, but *will* they? I think the most ardent supporters won't. They'll continue to work on alternatives like Kaffee and Classpath and Harmony. To them, it's about the fun of building stuff, not about avoiding the reinvention of the wheel. And though Java will soon be under the GPL, there's still the stigma of Sun being one of those big, evil, for-profit coporations. You still see a lot of "I'm not going to contribute to Java under the GPL and make Sun rich".

> Besides licensing Java under the GPL, The
> Swing team at Sun has also been hard at work
> improving the look and feel on the Linux desktop in
> Java 6. Take a look at the following two screen
> shots. One is the actual calculator from GNOME, and
> the other is a mock up I did in Swing using Netbeans
> and Matisse. Can you tell which is which?

This is the wrong question. The question should be "do both look decent?". You're also asking the wrong audience, Java developers, when you should be asking end users. Of course a developer, especially a GUI developer, will be able to see the pixel imperfections.
[snip]

> The shift away
> from C++ to Visual Basic was the start of the trend,

Was there really a shift from C++ to VB?

> but with Vista, and Microsoft's movement towards "All
> new desktop applications should be written as managed
> code in .NET", the ante is now significantly higher.
> Developers in the world of Windows desktop
> applications are now being encouraged to write their
> new applications in managed .NET code that makes
> their lives easier and less error prone,

..easier and less error prone than using previous MS tools, not at all easier or less error prone than using Java.

> as well as
> avoids major causes of security holes like buffer
> overflows. Linux desktop programmers, however, are
> still doing most of their work in C or C++, where
> they are still managing memory by hand, still getting
> routine segmentation faults because of memory
> management problems, and still dealing with the
> security hassles of C and C++. The time is definitely
> ripe for a change in the way developers write desktop
> applications for the Linux platform. In fact, that
> change is long overdue.

It is long overdue. In fact, I wouldn't say the time is ripe for Linux desktop developers to swith from C/C++ to Java. The time was ripe years ago (whether it was 2 years ago or 10 is debatable). If someone today is just getting around to realizing that Java is better than C/C++ for desktop apps, they have a big problem. I doubt they'll see the light now.

Anyone who had a problem with Swing a year ago will still have the same problem a year from now (presumably, it's slow/interpreted and it's ugly/non-native). The GPL won't change that, as I doubt there are many who were avoiding Java just because of the license.

>
> If Linux desktop application developers are going to
> make the transition to more productive managed
> languages, like Windows developers are doing, there
> are only two real platform choices they have: The
> Novell sponsored Mono project, or Java.
>
> To me, Java seems like a much more solid choice for
> several reasons. For one, it has a substantial head
> start on Mono, with over five more years of
> development behind it than Mono. Java is already a
> very stable and mature platform, where as Mono is
> still evolving quite rapidly.

In other words, Java generally works, and Mono generally doesn't.

> Also, Java has a vast
> collection of open source tools and libraries
> available to help with just about any type of
> development that one might want to do--something that
> Mono can't even begin to match yet. Furthermore, Java
> has a much larger development community in place
> already, and remains the most popular language for
> open source projects on SourceForge, as well as on
> FreshMeat.net, where Java has 5383 projects compared
> to only 284 for C#--making Java nearly 19 times more
> popular than C#.

And if you believe that about 1/3 of Java developers are client-side, then Java desktop developers outnumber C# desktop developers by a huge margin, too. And yet "the war is over".


> And finally, Mono is doomed to
> always lag behind the official .NET implementation
> due to the fact that Microsoft's actual
> implementation is completely closed source. Now that
> Java is open source under the GPL, the open source
> GPL version will always be up to date, since it will
> be the "official" implementation.

But the alternative open-source Java wannabes are not going away. Yes, Mono is "doomed" to never catch on because it can never catch up. But on the other hand, GNU/Linux did catch on because there hasn't been a lot of progress in the UN*X world for it to try to keep up with.

> Mono also has a
> hidden licensing trap that Java does not. Because the
> class libraries are licensed under the MIT license,
> which has virtually no restrictions on what can be
> done with the software, companies can conceivably
> patent their improvements or modifications on the
> libraries and then enforce those patents on anyone
> else making use of of the improvements or
> modifications. There is an interesting article on > href="http://www.newsforge.com/article.pl?sid=02/02/19
> /1651244">NewsForge about this problem. It's a
> little old, but still good reading.

Bleh. I guess I don't believe in any licencing "traps".

>
> OK, granted I may be a bit biased in favor of Java.
> But I think my above points were at least reasonably
> objective as to why Java makes the best choice for
> the future of the Linux desktop. With the open
> sourcing of Java under the GPL, Sun has removed that
> final barrier to entry, since all of the performance,
> or "it doesn't look native" arguments are no longer
> valid.

I see a Steve Northover response in your near future :)

>
> And finally, both Linux and Java benefit from using
> Java on the Linux desktop, since both of them want
> the same thing, and can mutually contribute towards
> the same goal. Both Linux and Java want greater
> desktop market share. Java can give this to Linux by
> providing a more productive, more secure, and easier
> to debug platform for writing applications, as well a
> platform so that applications written in it can also
> run on Windows. This helps protect the developer's
> investment in a minority platform when it comes to
> the desktop. And Linux has something to offer Java as
> well: a second chance at becoming a major player in
> the desktop application arena. Linux is slowly but
> surely gaining desktop market share. Java can help
> it grow, and also grow with it. It could be that
> desktop Java and desktop Linux are a match made in
> heaven.
>
> What's your opinion?

My opinion: everything you just said was also true 10 years ago. Yes, Swing (and Java in general) was a little bit slow and ugly, but those days are long past.

Any Linux developer who is just now starting to believe that Swing is better is sadly way behind the curve.
Andy Tripp, CTO and Founder Jazillian - Legacy to 'natural' Java.
5 . At 11:53 AM on Mar 7, 2007, Mike P wrote:
  Click to reply to this thread Reply

Re: Desktop Java and Desktop Linux: A Match Made in Heaven?

It certainly doesn't mean I'd feel "defeated" and "give in" and feel forced to start to have to code in .net. I'll continue to code circles around .net in Java thank you very much.
6 . At 1:01 PM on Mar 7, 2007, Mike P wrote:
  Click to reply to this thread Reply

MVM

I think there is only one thing standing in the way: an MVM, Multiprocess Virtual Machine.

If every little calculator, system tray, widget and gadget can all run in the same virtual machine, then all the memory arguments will go away. Startup will be more instant.

On the Gnome vs KDE rant, I don't like either. Gnome used to be cool, until they replaced, what was it, sawfish I think. It's now too basic and not configurable enough. KDE seems like a pig. I admit I don't have enough KDE experience, but I don't like seeing KDE messages clutter my terminal and I don't like the slow starts, it's like it's booting another sub OS or something every time I start something that starts with the letter k.
Everytime I install Linux, I check out how gnome progressed, get disappointed, and run back to IceWM. Java runs great on IceWM. Nice C++ code, easy to make code changes to. Open source at its best.

Many Java programs don't pay attention to the OS settings. Look at Azureus, SWT, with its own look and feel, independent from the OS look and feel or theme settings.
It's probably safer to use a more predictable fixed L&F instead of waiting to see if it runs on the various OS's.

About the Linux crowd. I love the innovation, but I can't stand the constant identity crisis like need to do things different just for the sake of doing things different. I really don't like Python, I think it's unstable, rogue, anomalous, it breaks after installing other Python stuff.
Perl would have been far better to do things like the Fedora installer (which randomly crashes btw).
I really don't like Mono either. Watch Beagle hog 100% cpu while doing nothing and flood the log files. Maybe not Mono's fault but the in Mono written Beagle app perhaps. But why Mono? Just so that we can start importing code from Windows, a dangerous practice.

ps. "war over". Yeah right! I think not! It'll *never* be over, *never* I tells ya!
7 . At 1:27 PM on Mar 7, 2007, Jean-Marie Dautelle DeveloperZone Top 100 wrote:
  Click to reply to this thread Reply

Re: Desktop Java and Desktop Linux: A Match Made in Heaven?

> Although the .NET vs. Java war is basically over for
> control of the Windows desktop, where .NET is sure to
> become the managed language of choice for new Windows
> desktop applications,

.NET is far from being the success it was touted to be .NET usage has been basically flat for the last two years and significantly lagging behind Java even on the desktop (85% Windows). As far as companies are concerned, cross-platform portability is more important than cross-language support (and a unique platform).
Jean-Marie Dautelle - Marlboro, MA
-- Javolution: Everything should be made as simple as possible... -- JScience: But not simpler!
8 . At 1:36 PM on Mar 7, 2007, ProTech wrote:
  Click to reply to this thread Reply

Re: Desktop Java and Desktop Linux: A Match Made in Heaven?

I think Java is behind mono in the desktop Linux war currently.

In order to create a native looking Gnome application you should use the gtk+ library. And the mono binding for the gtk+ is more mature. The gnome-java bindings currently rewritten from scratch, and god knows when will they stable enough to use them.

I think SWT/Swing applications will never look like native Gnome programs. It will be close to it, but never 100%. Like your calculator.

Novell pushes mono really hard in the desktop area. A lot of program written by the Novell Gnome developers are in mono. (Banshee, F-Spot). One mono program even make it to the official Gnome release (Tomboy).

I think the GPL java is late to this race.
9 . At 2:25 PM on Mar 7, 2007, Michael Urban wrote:
  Click to reply to this thread Reply

Re: Desktop Java and Desktop Linux: A Match Made in Heaven?

> I think SWT/Swing applications will never look like
> native Gnome programs. It will be close to it, but
> never 100%. Like your calculator.

Keep in mind I threw together that calculator mock up in 15 minutes. I think if I spent a little bit of time tweaking it, I could probably get it to look exactly like the native Gnome calculator.
10 . At 2:34 PM on Mar 7, 2007, Filip Selendic wrote:
  Click to reply to this thread Reply

Re: Desktop Java and Desktop Linux: A Match Made in Heaven?

> I think Java is behind mono in the desktop Linux war
> currently.
>
> In order to create a native looking Gnome application
> you should use the gtk+ library. And the mono binding
> for the gtk+ is more mature. The gnome-java bindings
> currently rewritten from scratch, and god knows when
> will they stable enough to use them.
>
> I think SWT/Swing applications will never look like
> native Gnome programs. It will be close to it, but
> never 100%. Like your calculator.
>
> Novell pushes mono really hard in the desktop area. A
> lot of program written by the Novell Gnome developers
> are in mono. (Banshee, F-Spot). One mono program even
> make it to the official Gnome release (Tomboy).
>
> I think the GPL java is late to this race.

Yep, Mono clearly won. With three applications and safe path for users which will not be sued by MS if they buy Novell products. And we all know how important for end users is that all applications look the same, especially like extra beautiful Gnome apps. Not to mention great potability that one gets when using GTK#, which is probably also the best and easiest GUI toolkit ever invented. Just imagine how easy is to run Beagle, with its beautiful look and feel, without any code change or recompiling, on Windows machines. Pure bless.

SWT is fine on Linux, Swing is actually progressing nicely with GTK LAF (http://weblogs.java.net/blog/campbell/archive/2007/02/swing_and_gtk_w_1.html)
and will progress even better and faster when necessary bits and pieces go opensource, and Mono is a such a huge dead end it is not even funny. Probably biggest mistake ever coming from OS crowd. Has something to do with Miguel obsession to fight MS on technical merits by copying what they do and following their lead. After, what, 3-4 years of development, Mono guys are simply blind to the fact that they are constantly loosing that battle, and they will keep loosing forever, making Linux desktop look bad (or should I say, even worse :) )in the process. And I don't even want to dive into IP rights which Ballmer is so nicely reminding us of every few months.

Java is a nice fit for Linux, it always has been, luckily, Sun finally recognized that. And it is not too late, the fun is actually just about to start. In last 6 months I'm seeing almost unbelievable push for opensource here in Europe. By the end of 2007 and, lets say, first half of 2008, Java be THE managed platform on Linux. Period. And on desktop front, its biggest "enemy" is not Mono, it is Javascript2.0, Firefox3.0 with its bundled database (and ability to work offline) and things like Flex. Proprietary standards and protocols and frameworks are dead here in Europe. By 2010 4% of European GDP will be in OS IT companies. Java has enormous demand now, and it will only continue to grow.

I don't know, maybe in US is different, but Europe and BRIC are clearly made their decisions. MS helped a lot with Vista delays, functionality, price and other practices. Even the most conservative entities here are now asking about desktop linux, with few quite big transitions underway. Simply not imaginable few months ago. It will take some time, and some pains, but it is moving forward, faster than I expected. And Java will play a big role in that movement.
11 . At 2:49 PM on Mar 7, 2007, Michael Urban wrote:
  Click to reply to this thread Reply

Re: Desktop Java and Desktop Linux: A Match Made in Heaven?

> Yes, and of course, they also could do that at any
> time with the JRL.

The JRL itself is not that old though. And bundling it with a Linux distribution intended for end-user use would be questionable I think when it comes to whether that is within what the JRL allows.

> The ardent GPL supporters *can*, but *will* they?
> I think the most ardent supporters won't. They'll
> continue to work on alternatives like Kaffee
> and Classpath and Harmony.

I'm not talking about developers working on the JRE though. I'm talking about developers being more willing to write applications that require the JRE--developers who used to refused to write applications in Java in the past because it was not "true OSS".

> And though Java will soon be under the GPL,
> there's still the stigma of Sun being one of those
> big, evil, for-profit coporations. You still see a
> lot of "I'm not going to contribute to Java under
> the GPL and make Sun rich".

Sure. But those are the same people who won't contribute to Linux either, because they are making Red Hat rich, or Novell rich. When it comes to Sun, I think people are starting to see the "new Sun" that is proving itself to be more friendly to open source than any other company out there. Even Richard Stallman gave Sun his blessing and stated that with the GPLing of Java, Sun has contributed more software to open source than any other company.

> My opinion: everything you just said was also true
> 10 years ago. Yes, Swing (and Java in general) was
> a little bit slow and ugly, but those days are
> long past.

Well, 10 years ago a lot of it was not true. 10 years ago the "Java is too slow and uses too much memory" argument was pretty valid, since 10 years ago, the average person had 16 Mb of RAM in their system, or maybe even less.

> Any Linux developer who is just now starting to
> believe that Swing is better is sadly way behind
> the curve.

I think the number of Linux users and developers who refused to use it because it was not fully open source is probably higher than you think.
12 . At 3:29 PM on Mar 7, 2007, Richard D. Jackson wrote:
  Click to reply to this thread Reply

Re: MVM

> I think there is only one thing standing in the way:
> an MVM, Multiprocess Virtual Machine.
>
> If every little calculator, system tray, widget and
> gadget can all run in the same virtual machine, then
> all the memory arguments will go away. Startup will
> be more instant.
>
OSGi will solve most of the issues you have addresed above the one thing it does not address is multithreaded Swing/SWT. Or from my perspective a single ET (event thread) per top level window which I think would be easer to implement. With this one item we could do multiple apps in a single VM quite easly now. But then again do we really need it. With OSGi well written swing apps can be ran togeather in a single VM already and it is not a hack to make it happen.

This is something I've been giving a lot of thought to latley. I just need to decide if I want to do it.
13 . At 3:53 PM on Mar 7, 2007, Romain Guy DeveloperZone Top 100 wrote:
  Click to reply to this thread Reply

Re: Desktop Java and Desktop Linux: A Match Made in Heaven?

"It's pretty hard to tell the difference though isn't it?"

Unfortunately, and as much as I'd like to agree, I have to say that it's not hard to tell the difference :) Look at that crappy textfield!

But seriously though, it's good to see those improvements on the GTK look and feel.
Romain Guy
Romain Guy's Java Weblog, #ProgX, Jext
14 . At 4:23 PM on Mar 7, 2007, junkgui wrote:
  Click to reply to this thread Reply

Re: MVM

> Gnome used to be cool, until they replaced, what was it, sawfish I think.

It has been a few years hasn't it... Metacity was a very light weight replacement for sawfish and was the first in a wave of changes to modernize X windows... Now it is several years later take a look at beryl or compiz. Look for them on youtube the demo videos will give you an idea of what you are missing.

thread.rss_message