Posted
by
simoniker
on Monday June 07, 2004 @04:56PM
from the bright-disposition dept.

Jahf writes "Sun has released the JDIC / JDesktop Integration Components API via the LGPL. The idea is to create a Java API that allows Java applications to better integrate with a modern desktop. It allows apps to embed a web browser component, access/launch desktop applications and associate filetypes. Documentation and demos are available and there is an incubator project (SaverBeans Screensaver) under way. Sun has been a proponent of developing desktop apps in Java, including a number of open source Java apps in the Java Desktop System and developing new ones for it as well (Java System Updater), and this appears to be a step towards making that goal a bit easier. I'm sure that every release of Java Desktop System (disclaimer: yes, I work on it) will continue to get the 'it has nothing to do with Java!' trolling since Sun is using GNOME as a desktop foundation (imagine what people would say if Sun created a 3rd environment in Java!) But those willing to step back and look at all facets (JDIC, Java Desktop System, Looking Glass previews, etc), hopefully others will see that Sun is getting more serious about making Java a platform for desktop developers."

That's a much better license than I was expecting. Of course, I don't know just what is being covered. It's important to know that before giving Sun too much credit. (Still, they haven't been slow about being viscious in public, so no reason for them to be subtle now.)

Sun has simply figured out that it doesn't matter if they make some parts of the platform open source as long as they still control core portions of the platform.

And Sun does: not only is there no complete open source implementation of crucial components like Swing (although the SWT-Swing effort may be changing that), even if people should manage to make a credible and complete open source Java 2 implementation, Sun's licensing restrictions on the Java specifications and their Java-related patents would probably let them shut down or control any such implementation should it become a threat to their dominance.

Classpath itself is "already there". Classpath is slowly being merged into libgcj.

OTOH GCJ is far from replacing Sun's java (at least in terms of speed). To compile java properly you have to do some funky runtime optimizations (which sometimes even require un-optimizations!), something that the gcc infrastructure doesn't really allow. That's why you get considerably better running speeds with Sun's or IBM's JITs (although you do get better startup speeds with gcj)

... shouldn't they have done this 4 or 5 years ago? Why now? We could all run Java based browsers and applications if those guys would have put their thinking caps on half a decade ago. Just my personal opinion - as usual, I could be wrong;-)

I agree completely. They had their perfect cross-platform platform back then. They could have done so much, back when there was no real competition in that area (read desktop apps, such as browser, office, etc...), that every move they make now just look odd at best.

Five years ago the main GUI for Java apps was the AWT, which just didn't sit well with a lot of serious developers. Swing was in its infancy, was dog slow at the best of times and didn't play well with threads. If they had tried to do this then, or anytime before Swing became a lot more usable, then it would have died before anyone noticed. They probably could have done it a little sooner, but its possible that because they now ship Gnome instead of CDE they're rethinking some of they ways the deploy a GUI desktop, or are making it easier to create apps with Java across all installations for desktop oriented tasks so that more programmers realize what can be done with Java.

I could see (and agree with) the point about noticeablely slow app response times in 1998.

But now Joe Schmoe can get a 2.0+ GHz CPU with 256-512 MB of RAM with nearly 3 GB/s of usable memory bandwidth. Unless there are some really serious performance problems with a particular runtime environment, there is no reason for a Java app to run noticeably slower than an precompiled machine binary app in the language of your choice (barring serious number crunchers, of course...

Last time I tried Espial Escape, it was quite fast. 100% pure Java. Of course, the downside at the time was that it was pretty much compatible with NS4, which is now useless, but I read that things are evolving quite fast on that front...

Java is not necessarily slow. Badly coded Java can be, but Java itself tends to be quite fast. I know companies that are writing essential services with 5 9s reliability in Java because it's fast enough and a lot easier to maintain.

I'm sure that every release of Java Desktop System (disclaimer: yes, I work on it) will continue to get the 'it has nothing to do with Java!' trolling since Sun is using GNOME as a desktop foundation (imagine what people would say if Sun created a 3rd environment in Java!)

neverind the trolling you'll get because GNOME is being implented in.Net/Mono instead of Java....:)

I think what the original AC meant was that there was talk not long ago about Gnome version 3 or 4 being written to function within Mono, thereby delivering.NET to the Linux desktop via Gnome, which Sun uses. JDS = GNOME = Mono =.NET on Linux couldn't be more wrong, but I get what the intent was.

Java -- liked it, thought it was the future, then it ran slow on the desktop so I stopped looking at it. I heard it's great on the server side, though. Then processors got faster and memory got cheaper so I thought hey, let's do Java on the desktop again!

Enter the debate of AWT, Swing, JFC, and all these other widget libraries. I tried the free Forte for Java and JBuilder to make me cutesy GUIs. I compiled and ran it on a Win98 box, transferred it over to a Linux box, and it worked spiffy except for a few font complaints. I had issues creating a jar file, though, and eventually got sidetracked away from the language altogether.

In the end, Java seems like an abusive friend -- I keep going back, and it keeps giving me pain. Haven't gotten around to running Eclipse and trying again. Not sure if it's safe to give this 'relationship' another shot.

Thus the cycle continues -- effort to learn Java depends on its success on the desktop. Success on the desktop depends on effort to learn JavaHmm, interesting. I don't actually think the effort to learn Java is that big. But of coure I already know it, so I am biaised...

As for the jar file, I ended up creating one but wasn't able to launch it from the command line. Something about explicitly pointing to the main class or whatnot.So a jar file is nothing else but a zip of a bunch of.class files and a fe

Sounds like some fairly basic issues. Not hard to do a google search on. Of course, it should just be pinned on Java, right?

Java is about as intuitive to learn as MSVC... while the core language is simple, making a nifty little GUI work is not. It's easy to make a "hello world" jar that runs from the command line, but making an actual graphical applet that runs that way is quite a bit different.

while the core language is simple, making a nifty little GUI work is notI totally agree with that point of view. It's actually not the fault of the language/libraries at all (IMO) but for the lack of a decent GUI builder. I haven't tried JBuilder & others in a while, but the last time I tried, it was really ugly (As compared to other nice GUI builders for other languages).

I'll go out on a limb here and suggest that any non-trivial platform you want to use is going to take some time to learn. The JSDK has a TON of docs that come with it. Put some effort into it and read them. Esply the part on the jar tool.

Looking glass is way cool, I am itching and burning to get my hands on a copy of that (and perhaps some ointment).

Java Desktop is gnome with a new theme. Seriously they didn't even do as good a job as Redhat with Bluecurve in pretending that it was anything more than that. I suppose the real benefit is the legitimacy that it lends Linux on the desktop to the PHBs of the world, but technically it appears to be nothing to get excited about.

But the demos I've seen for looking glass....damn. It looks like Apple's Expose on steroids.

Java's memory footprint is currently too large to allow numerous java programs of a moderate complexity (and size) to be running simultaneously on the desktop. Until Sun gets VM sharing going, we will not see Java attain a strong desktop presence. And, in the meantime, Microsoft will be cleaning Java's clock with.NET.

I work in Java and would love to see Sun devote the effort required to make Java *truly* desktop ready. However, I fear that that is not a priority for Sun, and instead we'll see.NET/C# rule the desktop. Hope Sun proves me wrong.

Java's memory footprint is currently too large to allow numerous java programs of a moderate complexity (and size) to be running simultaneously on the desktop. Until Sun gets VM sharing going, we will not see Java attain a strong desktop presence.

That's a step in the right direction, but it does not go far enough. As the blurb says, only 5 to 6 MB gets shared. I am running JDK 1.5 beta2 and to be honest, I haven't noticed much (if any) savings (this is on Linux 2.6.5, don't know about windows). I currenly have 3 Java progrmas running using 511MB, 288MB, and 276MB (the first one is eclipse) according to both gtop and ksysguard. They are easily the top 3 memory pigs of the 150 processes currently running on my desktop. It is possible that gtop and ksy

I haven't noticed much (if any) savings (this is on Linux 2.6.5, don't know about windows). I currenly have 3 Java progrmas running using 511MB, 288MB, and 276MB (the first one is eclipse) according to both gtop and ksysguard.

There could be a lot of shared memory there, you really can't tell wether that happens using only the tools you mentioned.

IIRC Solaris has a command called pmap which can be used to see this. My Linux box seems to have that command too but it doesn't seem to do anything.

Is what you propose going to be in.NET. If so then I would want to avoid it at all cost. Just imagine if one of those classes has a bug, and it crashes the VM. Now Microsoft wouldn't develop any buggy classes would they?

Sun or anyone for that matter has to be very very careful on how they do this. IYour example "Eclipes", isn't a good true world test. How much memory does visual studio take up? IDE's have always been hogs. On some systems Outlook takes over 300MB to load. Getting the initial VM lo

Java's memory footprint is currently too large to allow numerous java programs of a moderate complexity (and size) to be running simultaneously on the desktop. Until Sun gets VM sharing going, we will not see Java attain a strong desktop presence.

The thing which was added in 1.5 improves startup time, but each JVM you run still takes the same amount of space, unless they say otherwise on a different web page. JShell, on the other hand, solves the memory issue. (I wonder why this couldn't be worked into a core feature.)

Java's memory footprint is currently too large to allow numerous java programs of a moderate complexity (and size) to be running simultaneously on the desktop.

By default the 1.4 JVM allows a default maximum (note 'maximum' of 64MB per application, but there is no reason why an app needs to use anything near that. The full Swing GUI demo (a pretty complex app with memory-hogging features) from Java 1.4 runs comfortably in 32MB.New machines are purchased with around 512MB of memory. That is enough to run more than 10 copies of this app.

If you use something like SWT; a portable GUI library with native code bindings you can run Java apps GUI with memory requirements a lot smaller (Swing is a memory pig). You can run many more GUI apps. If you don't require a GUI, Java apps can require memory requirements of the order of single figures of megabytes, including the VM for each app.

How many Java apps do you want to run - 10, 20, 30, 40?

Microsoft will be cleaning Java's clock with.NET.

Why? For now.NET is simply an alternative desktop development environment. Microsoft have a very low presence in the mid-range and high-end server market. Unless a full-featured (not just Mono) enterprise-level.Net is released to the Unix market.Net will have very little impact on the server side, which is where Java has a dominant and growing presence.

Java's memory footprint is currently too large to allow numerous java programs of a moderate complexity (and size) to be running simultaneously on the desktop.

True. Version 1.6 of java is suppose to finally solve this issue. There are serious concerns that have to be addressed: namely security and stability. If I have two apps running on the same VM it is possible that they could one could crash both or look into the other ones memory space. Kinda icky..NET has no solution for this problem. Unless

The biggest problem in naming it the Java Desktop System is that you are making your product lines vague and ambiguous. Didn't you learn anything from watching the whole Microsoft.NET hilarity as that ensued.

Why not name it the Linux Desktop System, thereby keeping naming distinct between OS and development technologies? Sure, it's good to tie them together, but you need some focus and clarity among the things you are trying to push.

Now, somewhat more contraverial, is you also need to recognize the contributions of the many people who's code you are selling. It would seem a responsible thing for a member of the community to acknowledge their participation by helping promote the name (Linux, GNOME, whatever). I'm not trying to flame Sun, because they've done some nice things with ATK and OO.o, etc. However, as a Linux supporter, why should I go with Sun over IBM or Red Hat when both of those put forth more effort to evangalize open source?

Because it will not always be Linux underneath. Running the JDS just means you have a common set of apps, ui, libraries and java. It could soon be Solaris x86 underneath or a sparc version running on Sunrays (which I still think are cool).

Now, somewhat more contraverial, is you also need to recognize the contributions of the many people who's code you are selling. It would seem a responsible thing for a member of the community to acknowledge their participation by helping promote the name (Linux, GNOME, whatever).

It would be somewhat ironic if Sun felt obliged to include Linux in the name for these reasons given the hostility the OSS community has against the acknowledgement of GNU.

For a company that claims it doesn't want ot see java splintered by open source Sun sure is trying to make things complicated. First they have awt, then swing, then IBM jumps in with SWT, ok fine IBM evolves the Java Desktop and it looks pretty good. See eclipse [slashdot.org] But now Sun releases another API for the desktop that, while different in purpose, is not compatible with SWT. Great. not to mention the fact that it uses GNOME (a.k.a..NET-Just wait). How does this help make Java a more unified platform?

You are wrong. This is just a library, it's not part of standard libs of the language. So this isn't fragmenting anything. And Sun can't prevent (why would want?) anyone to make their own libraries, as long as they don't change the standard base library, like SWT which works on Java, you choose to use or not. That may do a little fragmentation, but it does run over Java anyway. It's not like J++ which changed the language with propietary reserved words.

Why? Sun have kept the core of Java and the bytecode stable while opening up parts of the spec so that other companies have been able to offer a variety of APIs. What is your problem? You don't have to use any of these APIs if you don't want to. You can write as many Swing or SWT apps as you like. You can even combine them into one program. If you have an issue with what Sun has done, you can write your own alternative.

But now Sun releases another API for the desktop that, while different in purpose, is not compatible with SWT. Great. not to mention the fact that it uses GNOME

This is all wrong. Its an API to integrate with system services. Its completely compatible with SWT and Swing: you can use the desktop components under Swing or SWT. So what if it uses GNOME? Do you need Sun to provide everything for you?

It makes Java a more unified platform by providing a new API that gives portable access to some useful syste

Well this is probably just a thought, but if the integration API is open, then we can surely implement the API to work on vanilla GNOME and KDE. We would just use the KdeJava and JavaGnome projects to provide whatever tinkering we need to do, right?

I guess it could be something to play with. I've been missing an officially-supported way to interact with the desktop for a while now... starting from the basics of the system tray icon and working on up.

Now if they could make it so you don't have to start up a separate VM for every application...because it takes too much memory AND too much time.

They've needed a process model for a long time. That's still the critical piece needed to make a "Java OS" a reality. (AFAIK it still is missing...)

Of course there is the copout that the interpreter ends up in shared memory anyway. But what about loaded classes? Are they shared between apps? I think not.

Of course, applications can be written to become threads in an existing VM rather than intended to start up on their own, but that generally isn't done. This way Sun can ignore security issues between apps within the sandbox by saying well, just start up a new sandbox for every application, and there is no way they can step on each other. Moore's law has had many cycles now since Java came out, and the cost of even one VM is still not negligible, let alone one per application.

Then there is the fact that Swing applications always look so unique, so volatile and unreliable, due to the fact that they paint slower, and you can sometimes see unpainted gray areas, at least temporarily. They make a bad impression, like old cars going down the road perpetually in primer, the "restoration" incomplete for years on end, making you want to ask "when are you ever going to use real paint!" They should instead work on fleshing out AWT to include the missing widgets, like trees (just implement their own native versions on the few OS's whose GUI toolkits don't have them), and screw pluggable look-n-feel. That should be a toolkit feature for the whole OS, not just for Swing applications. This approach is largely responsible for Swing apps looking and feeling so crappy.

I'm using Java 1.5 for several months now, and besides the new language feature goodies it also has shared [sun.com] memory between applications.

Now I can't say how much better swing has gotten since 1.4 because a dont' remember how good it used to be;) but in 1.5 it's pretty good. No reason why I'd hesitate to do any UI in java anymore. It's way better than in 1.2 or 1.3, that's for sure.

I'm going to follow an increasing trend on Slashdot these days and come right out and admit I haven't read TFA.

I'm also going to follow an age-old trend of mankind and blame the victim. Really, Sun; with all of the incomprehensible noise that's been coming out of official and semi-official channels, who can blame me? The Kremlin during Brezhnev's dotage was more on-message than you these days. Clearly you were asking for it.

But anyways, if this doesn't include a less-restrictive license on the JRE such that it could go into Fedora, Debian, free-as-in-beer SuSE and other non-commercial distros, who gives a fuck? I don't even mean GPL - even a patches-only Minix-style source license; hell, even just free binary redistribution without selling your firstborn to Scott McNealy would do it.

Yes, yes, I know; those aren't enterprise Linux. But they are what enterprise Linux guys run at home.

If Sun really wants Java to be the platform of the future, they've got to make it possible to install as part of a platform, rather than an afterthought added in after you've already got kernel, services, gui, and browser application running.

Can someone please explain something to me, as I feel I am being stupid.

When some Linux developers are so keen and eager to download all kinds of software, do they complain so much about downloading a free Java development environment from Sun? Its free to download, free to use, and you can freely distribute the run-time with your apps.

I remember when, years ago, Linux people did not like to have pre-installed systems, and preferred to have the freedom to set things up for themselves. Have things really

When I want to install a program that uses a language other than Java, I type 'emerge program'. When I try to install a Java program, emerge tells me I have to go to sun's website, download some huge file, install that and then I can install the program I care about.

Then, as you mentioned, there's the whole freedom to set things up idea. I have to download and install things like Swing even if I don't want them. Nothing else in my system works that way so I can't understand why Java does.

It is not currently an ideal platform for desktop-side solutions. There are a number of reasons for this. One of them, and the most easily remedied of them, is that the current licensing scheme places restrictions on the distribution of binary JRE's.

It may be that Sun is content with the status quo; after all, there's more and safer money on the server. In which case greater ubiquity for the JRE would be of no concern to them.

I've been developing in Java for close to 7-8 years now, and am a great advocate of Java - for those tasks that fit it. I think Java on the server-side is a very powerful thing, but that it just wasn't ready for the desktop up to and including v1.4. Try running 10 copies of Notepad - and then try running 10 Notepad-equivalents in Java, and see the difference. Having said that, v1.5 bringing virtual machine sharing should have a big impact on this, but I have not yet had the opportunity to evaluate how much of a difference this makes on the footprint.
I recently had to demo an old application that we developed back in '98 for Java 1.1/1.2, on both Windows and Linux using Sun's 1.4 virtual machine. I was appalled to see that the application, which had very good performance on Windows, was unfortunately having quite dramatic performance issues when run on Linux (Tests were done on a dual-boot machine).
Java on the desktop - yes, great. But up until 1.5, it wasn't the time. Maybe things will change now.

I am quite happy to see so many innovation lately in the market in order to make Java to be more desktop friendy - I am a Eclipse fan and I think Sun is trying to dampen down the momentum being built up in the Eclipse RCP (Rich Client Platform http://dev.eclipse.org/viewcvs/index.cgi/platform- ui-home/rcp-proposal/rich_client_platform_faciliti es.html?rev=HEAD) camp.

Anyway I am not particularly worry about splitting the community - the best will wins in the long run - look at GNOME and KDE - there has be

Sun has been a proponent of developing desktop apps in Java, including a number of open source Java apps in the Java Desktop System and developing new ones for it as well (Java System Updater)

Yes, and Microsoft has been a proponent of developing desktop apps in Windows. That's because it is valuable for a company to popularize a platform that they control. Since Sun can't get a lot of commercial developers of desktop software for Java, they do the next best thing--they try to sweet-talk open source deve

Have you used the latest versions? 1.4.2 or even 1.5? In fact, Swing feels faster than GTK on my current machine. I have not made any benchmarks, but it's just the feeling I get. In any case, to me that is proof enough that Swing has finally become "fast enough".

You're absolutely right, there. The problem is that there are good Swing developers and there are shit Swing developers. It's just that unfortunately, the shit developers, who seem to be unaware of Swing's single-threaded application model, seem to be the majority at the moment, so you get all kinds of applications which pause during rendering because they're performing some other work from the wrong thread.

But certainly comparing the two competing APIs using an app written with each by the same develope

Strange considering that there are sooooo many Java server applications out there and more being written every day. Weblogic and Websphere aren't 'developer desk'-names for nothing. Java is far more suited to the server than it is on the desktop at this time.

Java is getting much better on the desktop (FINALLY), but it is most definitely at its best on the server.

Had Java used widgets that didn't look like a throwback to Motif it might have been slightly better.

Then don't use these widgets. Use any of hundreds of Swing look and feels, or use versions of SWT that use GTK, or Windows, or Aqua.

Instead Java UIs tend to be a usability nightmare.

There is nothing intrinsic about a Java UI that is a usability problem. With any Java GUI you can design your own buttons, add your own accelerators, menus, colours, tooltips. I think you are confusing the bad design of some particular applications with what is potentially possible using a GUI toolkit. Its like saying that GTK is bad in general because you have seen some badly designed GTK apps.

Even Eclipse, which is far and away the best app I've seen in Java has nowhere near the visual polish as its GNOME, KDE, Aqua, or Win32 equivalents.

This does not make sense: Eclipse uses GTK, aqua and Win32. It uses those native widgets! Eclipse is a native GUI program.

I took an interest in Java for desktop work a few years ago, but quickly realized that Java on the desktop is even worse than Java applets were. (And at the time they were both incredibly atrocious.)

So we already know where this is coming from. Someone who saw how bad it was in the past and hasn't kept up with the improvements: "Perl was pretty crap in version 1.0, therefore Perl still sucks today."

Even with the increases in processor power, storage, and memory, Java is still atrocious, even compared

Won't happen, know why? The Java security sandbox. In 50 words or less, if you don't launch the app, it has no avenue for propagating itself since a) there's no file I/O available, b) no way of spawning an external process, and c) no pointers so it's impossible to exploit a buffer overflow. The only malicious Java code I've run across in almost 10 years now was in the form of a trojan. Even then, the trojan can't self replicate (see above). Conversely, MS conveniently included memory pointers in.NET, hell

How long before we start seeing Java worms? It's only a matter of time. How will we blame Microsoft for them? They'll be cross platform worms.

Nonsensical FUD.

Java has security manager features that have been tested and refined over a decade. Java was designed from the core to protect against such problems - every memory access and every class loaded is validated.

The only redeeming feature is that with the performance that Java provides, propogation of such worms will likely be a bit slower than the us

Unless you use Swing, which is a critical component for writing desktop apps unless you resort to non-standard libraries.

Sun, swallow your pride for just a second and deprecate Swing (yes, ALL of it!). Then adopt SWT instead and you'll be doing the community a huge service. It's no surprise that the only usable desktop Java apps I'm aware of use SWT. In addition to Eclipse which most here are probably aware of, take a look at Azureus [sourceforge.net] for e

Unless you use Swing, which is a critical component for writing desktop apps unless you resort to non-standard libraries.

Why can't slashdotters be up to date?

SWT is good, but sometimes its useful to have a consistent look and feel across all platforms (saves on user guides, for example).

Swing isn't slow anymore. It was really dreadful and unusable years ago, but there were major performance enhancements under Java 1.4, and Under 1.5 the native code for your apps is cached on disk. Next time you start,

My criticism stems from significant experience developing GUIs with Swing under v1.4, which is the latest non-beta release. And sorry, Swing is still dog slow for anything but trivial GUI stuff (e.g. menus and dialogs).

Maybe it's "good enough" in 1.5 but I doubt it. The problem is one of poor design choices (e.g. object-creation-happy apis), and all the kludges in the world (e.g. caching compiled native code) are unlikely to change that.

Java's major strength comes from server-side application programming (web pages), an area where Java has proven extremely effective (not as a language, necessarily, but as a platform). There's been some improvements on Java GUI applications over the years but their GUI system is still a little clunky and bug-prone. The only good reason to install a JRE is to run Applets, which are clunky webpage embedded GUI apps from before the Flash days. Applets are common on educational websites for demonstrating ideas

Launching an executable from Java requires either access to a native library, or the Runtime.exec() method. By default, web applets can't do either, so they probably couldn't use this functionality at all. (Which is how it should be.) But I can't verify this without looking at the internal workings of the library.

Which brings me to my question: Where's the source code?? The download page only shows binary packages. Did I miss something?

I probably don't understand what your concern is, but wouldn't you just use the same mechanism you use for anything which is Java-based? That is, if the location the jar file came from isn't trusted, you don't let it access protected stuff. If you want it to, add its location to your security policy.

Excuse me for saying that, sometimes C/C++ can be faster, and some times Java can be faster. It really depends on the application, and also the JDK. Sometimes C++ is faster and sometimes Java is faster, from my own benchmarks, and from others I have seen. There seems to be a lot of contradiction.