Java 1.6: Finally Integrating With The Underlying Platform?

We all know the Java promise, Write Once Run Anywhere. And we all know some things are too good to be true. On the one hand, there are those features that don’t quite work the same on different platforms. That’s just a fact of life in portable programming, which I can deal with. On the other hand, there is the lowest common denominator syndrome. Important features that are only available on some platforms are non-existent in the Java APIs. The excuse for the absence of such APIs is, of course, that they can’t be implemented on all platforms. This I can’t stand1. I don’t expect every platform-specific API to be exposed, but some are just too important to ignore. Unfortunately for Java programmers, Sun has managed to ignore several for quite some time, for example:

  • Unix style file permissions: applications that work with Files (yes, there are a few of them) often need access to the read/write/execute permissions. I have seen (and written) plenty of ugly workarounds to use the stat/chmod commands to achieve the desired result. A request for this functionality can be found in the bug database from as early as 1997. Sure, the permission systems are different on other platforms (notably Windows), but you can cover a huge percentage of use cases with a small amount of work. Finally, in Mustang, we have the ability to get and set the permissions.
  • Free disk space: those applications working with the file system may also want to make sure they don’t fill it. It is a lot easier to prevent disk exhaustion than to recover from it. Looking back, poor Java developers have been hoping for this ability since 1997. Finally, Mustang delivers.
  • Masked command line input: the primitive Java APIs for command line interaction make it near impossible to create a usable command line interface. An example of something simple which you cannot do without crazy workarounds is prompt for masked input, e.g. to get a password. yep, you guessed it, there is a request from way back in 1997. Finally, in Mustang, we have the new java.io.Console class that provides a readPassword method.
  • System tray icons: many applications that wish to integrate with popular desktops on both Windows and Unix need the ability to use the system tray. It’s an expected part of the user’s desktop experience. The earliest request I found for this one is from 2000. The nice part is the Mustang support grew from an external project, so in this case the users were a bit more empowered.

It’s quite sad that Java developers have had to wait a decade for such commonly-required and relatively simple APIs. No wonder Java has had trouble getting a foothold on the desktop when it has been so difficult to make an application that integrates well with the underlying platform. I just hope the arrival of this new functionality in Mustang is a sign of a new attitude towards such features. No more hiding behind the platform independence argument, time to just get on and give people the tools they need to get the job done.


1: It’s worth noting that this sort of attitude is not restricted to the Java community. I can’t count the number of times that I have seen people in the C++ community reject ideas for additions to the standard library because “C++ runs on platforms that don’t even have a file system”. Who cares when 90% of C++ code runs on systems that could use this functionality!


Interested in automated builds? Pulse 1.2 is now in Early Access Release. Check it out!

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • digg
  • DZone
  • Ma.gnolia
  • Reddit
  • Simpy
  • Slashdot
  • StumbleUpon
  • Technorati

6 Responses to “Java 1.6: Finally Integrating With The Underlying Platform?”

  1. Sean Says:

    Any word on when Java will FINALLY give access to ioctl and fctl?

  2. sumfag Says:

    System tray icons: many applications that wish to integrate with popular desktops on both Windows and Unix need the ability to use the system tray. It’s an expected part of the user’s desktop experience.

    It’s an undesired, annoying part of the user’s desktop experience.

  3. Payton Byrd Says:

    System Tray icons are vitally important for reducing clutter in the task bar of modern desktops. The ability to have a strong mnemonic that can display a lot of data but only takes 16×16 to 32×32 pixels is very valuable.

  4. DJ Noha Says:

    The problem with system tray icons is not the potential for good, it’s the potential for evil. Every application and driver seems to feel it not only a right but a duty to put a useless icon in the system tray. People who would never stand for applications or drivers taking up space in their task bar at all times (even when not in use) seem to have no problem with those same apps installing permanent system tray icons that serve as no more than shortcuts to launch the app. I can’t count the number of people I’ve watched click on app after app in their task bar, trying to find a specific window, because their system tray icons are taking up well over half of their task bar space, leaving almost none for applications.

  5. Jack Says:

    Re the footnote: The Boost filesystem library is (probably/likely/almost certainly) going to be integrated into the next revision of the C++ library.

    Also I think it’s worth pointing out that the C people are in the same boat. All of the Unix-y things like terminal control and low level file access are in POSIX rathern than the base C standard.

  6. GonAffefe Says:

    Привет всем хотелось бы предложить вашему вниманию,
    свежие горячие тины !

Leave a Reply