Wednesday Mar 18, 2009

JDK 7-watch

For those of you who track these things, we are on Java SE 6, Sun's JRE is at version 6 Update 12.

The next JRE update of note will be 6u14 (in early access), which includes some handy performance impovements, the G1 collector (for use, but not yet the default collector), and some preparatory changes like loading anonymous classes which will turbo-charge dynamic languages in JDK 7.

And of course the next major update will be JDK 7, so you may be tracking the latest JDK 7 builds, which have been including API additions ahead of the release for some time. Like changes to the language model as Joe summarizes here. Or the new ability to close() a URLClassloader since b46 that Michael blogged about here.

Or, more significantly, the inclusion of latest draft version of JSR 203, in particular the new filesystem API, one of the larger features on the list for JDK 7.

Monday Mar 16, 2009

A Twitter Client is the new Hello World

The growing chorus (amongst a cacophony) of very usable Twitter clients that use Twitter's REST API and run on the JVM, show to great effect that the Java runtime is a lovely place for a RIA app to perch.

Like Greet (start) which is build on the Griffon framework. Griffon uses the Groovy language and Swing components, and just hatched its 0.1 release.

Or the Simple Twitter Client, (start), built with the Scala language and Swing components wrapped in the Scala Swing package, as you can see here.

Or any of the JavaFX Twitter clients, Tweetbox (start) or TwitterFX, (start) built with the scene graph and JavaFX Script.

No news to those of you at last year's JavaOne ScriptBowl, but nice illustrations of why, what some may consider dull plumbing: tweaking the bytecode, modularizing the JDK, and rewriting the browser plugin benefits all RIA apps that run there, whatever their language: they run faster, start quicker, and integrate better into web pages (or pull out too).

Thursday Mar 12, 2009

The Planet Cast: what do you want to hear ?

<script language="JavaScript" src=""></script> The Planetarium recently had a new delivery, so its time to announce the Planet Cast.

The Planet Cast is a new podcast series devoted slavishly to technical conversations with the expert engineers who help bring you Java SE, JavaFX, Java ME and JavaCard. (No marketing !)

What Planet Cast would you like to hear ?

Wednesday Mar 11, 2009

Java SE Traffic Management

Think of concurrent programming as nothing more than traffic management.

You may have been lucky in your programming work so far only to have to think about a single lane of traffic, relying on the road authorities periodically to raise the speed limit to allow your vehicles to go faster. But as hardware makers lay wider freeways with multiple lanes, and as your traffic gets heavier, you may need to start worrying about how to use the capacity better to get everyone where they need to be on time.

Perhaps building a thread gate, the equivalent of a traffic signal. As this article shows, and as applied to a prime number generator, a thread gate let you manage the execution of tasks where there are dependency on the completion of some of the tasks on others in your program. Just as traffic at a four-way intersection is regulated by a rule, albeit at intersections, a simple one: each two way direction takes it in turns to avoid collisions.

Or using a BlockingQueue, already part of Java SE. A BlockingQueue is something akin to the kind of smart traffic signals that tracks waiting vehicles to decide when to allow them to pass. This blog illustrates its use in bridging the gap between two intensive tasks: parsing large amounts of data from heterogenous sources, and persisting it.

Or, looking ahead to JDK7, a variant on the BlockingQueue called the TransferQueue, described in detail here. Although not a perfect anaogy, its smarter kind of traffic signal you have have seen metering traffic entering freeways, which takes into account both waiting vehicles and the flow of traffic on the freeway.

So if you're tiring of life in the single lane, maybe its time to experiment with the Concurrency Utilities in Java SE, and look further down the freeway to those coming in the future.

Update: Do check out Brian's talk about parallelism in Java from Devoxx here (How could the Janitor forget, he was in the audience). Thanks Patrick for the tip.

Tuesday Mar 10, 2009

Today's multi-language JDK

It can be too easy as you reach out for the next thing, to forget what's already in your hand.

This excellent detailed article on the Scripting Framework for Java, which is already part of Java SE 6 is just such a reminder, of what we already have, even as work continues apace to turbo-charge other langauges on the JVM for JDK 7. The Scripting Framework allows engines for other languages (like the one for JavaScript in JDK 6) to plug into the platform, and provides APIs for developers to evaluate code written in other languages.

In fact, the recently released Groovy 1.6, which includes a number of new language features (like optional returns from if/then and try/catch blocks, multiple assignments) as well as some handy peformance improvements, includes this pluggability layer into the JDK built-in.

And Python 3.0 has been turning the handle on new features. It's one of the 3 official languages of Google (the language of the Google App Engine, for example), and even runs in your hand today, on certain mobile phones.

As can Ruby, via the JRuby (Ruby on Java) project. Ruby's latest feature release (1.9) in January is one of the big ticket items for the next JRuby release.

Monday Mar 02, 2009

JDK 7: Language, the penny drops, Swings back

Small changes to the Java language can have a powerful effect. How many of us remember Java SE 5 as the release that included the for each loop ? Sometimes, the biggest doors are opened by the smallest keys.

As shown in number of informal polls a large number of ideas have been rattling about in our pockets for some time, but now the formal call for proposals for small language changes for JDK 7 is open for the whole of March, as Joe announces. And you can see the proposals (see this, for example) are already tumbling into the slot of the Project Coin mailing list and the subject of detailed discussion.

And, in other news, Alex just posted an update on where things are with the Swing Application Framework, and is looking for input on some remaining issues SAF could solve for JDK 7.

Friday Feb 27, 2009

Coming to JavaOne 2009 ?

Ahh, San Francisco in June. It has much to recommend it, in particular the JavaOne conference (cheaper if you sign up now). If you've never been before, this gives you a taste (or maybe this: illicit yet effective ?).

With more than 4 submitted proposals for every talk slot, its taken a couple months for the review teams, made up of people inside (your own Janitor included) and outside Sun, to work through the abstracts. With odds like that, and most of the talks or BOFs submitted in the four categories of: Core Technologies, Mobility, Services, and RIA looking very much like the kind of thing you'd want to go to (and even fill out the comment form for), its grim work to have to say no to so many.

This week, most of the emails got sent to let submitters know if they got lucky. If you were one of them, now's the time to start getting those slides and demos done !

Wednesday Feb 25, 2009

JDK 7: Checking in

Whether or not you are coming to JavaOne this year, you should count having a preview of JDK7 ready for you to try. So let's check in on where the larger features on the plate are at since Mark talked about JDK7 at Devoxx in December. (And since Alex gave one of his updates).

Modularity work is progressing with proposals up for comment in Project Jigsaw.

Good stuff coming in the VM with the support to turbo-charge Java SE for multiple languages, and the new garbage collector, which made it into the latest build of Java SE 6u14.

Though not enough for some Swing developers (who might be interested in this project), we'll bring some important improvements to Swing.

Java language-wise, Joe is sifting through the small Java language proposals as part of Project Coin. Opinions still welcome. And you check out the project that will add annotations to (all) Java types by trying out the latest Checker framework.

NIO2 is tuning the new APIs for scalable IO, including the new FileSystem API, which you can get in the latest build.

Wednesday Feb 18, 2009

Turbo-charging JDK 7 for multiple languages

John's excellent post on invokedynamic is a reminder that tuning the JVM to turbo-charge multiple languages running thereon is not a task for the faint of heart.

This new bytecode instruction that compilers for other languages will be able to use in JDK 7 (and some have already experimented with in the early builds) is not the only technique that will likely make it as part of JSR 292. But this technique is the most promising: it allows programmatic control over the dynamic linking of a method invocation, which has many uses, but is particularly useful for dynamically typed languages where the type information is not held in the source code, so can only be calculated reliably at runtime.

And the DaVinci project is a breeding ground for experimentation and prototyping of this and a number of other techniques in the same vein: some of which require changes to the specifications, and some of which don't. Remi gave a nice talk on this earlier this month at FOSDEM. Those others that have a reasonable chance to making it into JSR 292, include lightweight method objects (useful for languages that have closures), and interface injection (useful for languages where types in a running JVM evolve synamically).

Friday Feb 06, 2009

JDK 7: Project Jigsaw opens !

Yesterday, Project Jigsaw was officially approved in as a project in OpenJDK.

Jigsaw is defining a low-level module system for the purpose of modularizing the JDK itself for JDK 7. This will open up many new possibilities, including radically improving startup and footprint, new ways for parts of the JDK code to be used on smaller devices. Jigsaw will be using the work of JSR 294, the Java language additions for modularity, and so will provide news means for developers to modularize their own applications.

And its all being done in the open. Take a look at the draft proposals for the changes to the Java language, bytecode, VM, and the API additions under consideration to introduce this fundamental concept of a module into the Java Platform. Keep tabs on or influence future developments in the run up to JavaOne where JDK7 will be previewed, via the team on the development mailing list.

And check out Mark talking about Jigsaw and JDK 7 in this replay from Devoxx last December.

Wednesday Feb 04, 2009

Swing and JDK 7

Prompted by a vigorous discussion on Jonathan Giles blog about whether Sun is ready to do a 'Swing 2.0', its time to lay out where we (at Sun) are with Swing. So here it is.

Swing and Sun

Swing is really important to Sun. We have a large and vibrant group of developers who are developing and maintaining Swing GUI applications. Its APIs, components and underpinnings are critical to Java's future position in developing rich client applications of all kinds.

In contrast to the early years of hectic build out of Swing, we've slowed the growth of APIs over the last few years. This is largely because, despite gaps in the API set for some applications, compared with those early days (or with JavaFX today), the Swing APIs are broad enough to build most enterprise desktop applications. And that which is not there can most often be added with a third party library or component.

Building with Swing. Building on Swing

At the same time we've also seen a growing role for Swing, and its underlying graphics runtime, as a basis or inspiration for other RIA technologies. Such as our own JavaFX, which uses both graphics stack and many of the Swing components in its desktop profile, or such as Griffon, Thinlet, Pivot and LWUIT to name but a few.

So our focus has been shifting (starting well before the advent of JavaFX, even of Java SE 6) from filling out what were then major gaps in Swing as a UI toolkit, to making it easier to develop with Swing, and to making the runtime deploy and perform better. Progress on both counts are a benefit to Swing developers but also to other technologies that depend on Swing and its foundation.

Sun's priorities for Swing and JDK 7

To that end, the priorities for our effort between JDK 6 and JDK 7 are: first to make the runtime lighterweight (faster download, faster startup), better integrated into the browser, and with improved runtime performance. Some of this we have already delivered in Java SE 6u10, but there is more to come. And second to take a big swing (!) at reducing the amount of boilerplate code and conceptual complexity in a developing typical swing application with the Swing Application Framework in JDK 7.

We've also set things up in OpenJDK to make it easier for developers outside Sun to contribute to Swing, and we hope to help integrate some backwards compatible features created outside Sun into the JDK. We'll be working with the XRender pipline team to bring graphics acceleration to Java on Unix platforms. Also in JDK 7 we'd like to include other components such as JXLayer, the DatePicker, and CSS styling also. And perhaps other components or features, as mentioned in some of the comments in the thread, all such contributions depending on the usual constraints of quality of implementation, accompanying tests and of course, timing.

On a related note, some have mentioned a desire to use JavaFX features from Swing: we're interested in hearing what kind of Swing applications you are writing that might require JavaFX components to be embedded as we figure out the next releases.

Not ready for an incompatible revolution

Now, some of the discussion at Jonathan's blog reminded us of the many areas in the APIs that need updating: largely because of the advent of new Java language features and SE APIs that were added after the Swing APIs were created, that now provide much more convenient and reliable ways to manipulate Swing than were possible before. But we have a more conservative attitude towards breaking backwards compatibility than some of the commenters on the thread (and beyond): an attitude formed out of years of talking with developers and customers who depend on Swing. (As an aside, you may be curious as to the inherent design issues regarding the EDT). Now JDK 7 modularity will likely provide a neater way to move gracefully to some possible future backwards-incompatible version of the Swing APIs. But in terms of where we put our effort today, we don't think such an evolutionary cleanup, albeit useful and desirable, its enough reason to disrupt existing applications, tools, books, tutorials, courses and frameworks that are built with today's Swing.

Are you ?

But if what you want is revolution not evolution, if you would like to see bigger, more radical changes inside Swing, then please consider that you have all the source code for Swing together with the supporting infrastructure to create a project and broadcast its existence at

It's why, in part, we set up OpenJDK: to make it easier for you to bring the next big RIA idea to life.

Friday Jan 30, 2009

Decoding the JVM, Clojure and the module keyword

If you've never dared do more that up the maximum heap size on the JVM, but have wondered which methods in your app the JIT is compiling, or have been curious about seeing what happens to your app when you change garbage collectors, you should check it out Charlie Nutter's awesome crib-sheet on some of the HotSpot JVM dials and knobs that he's been using in the quest to further improve the performance of JRuby.

And speaking of other languages on the JVM, there was an interesting interview at InfoQ about Clojure with the author of a new book on this functional language with a special penchant for concurrency. Its a language that is not object oriented (is it the past, is it the future ?), but nevertheless holds many capabilities for modularity via namespaces and multimethods.

And speaking of modularity, Alex has posted two calls for comments in regard to the modularity work for the Java language for JDK 7 in the Java language, part of Project Jigsaw. First, the problems to address, and second a statement of the requirements of the project. You read the discussions here, or get it in your inbox here by signing up to be an observer of the expert group.

Tuesday Jan 06, 2009

The year ahead for Java and JavaFX

2009 promises to be an exciting year for Java: The Planetarium expects Java SE 7 to be mostly completed, with modularization, multiple languages being a big deal, JavaFX will ship the mobile profile, and preview (and possibly complete) version 2 including the TV edition, Java ME should finish or get close to finishing its next mobile edition, and we should continue to see lots of mobile frameworks and app stores.

Others are looking into their crystal balls too, like Joshua predicting you should consider JavaFX for an app next year, and Charles seeing big growth JavaFX and other Java based RIA technologies, and others the reduction of AJAX to a resume keyword. If 2008 didn't crown a winning RIA technology, will 2009 ?

Java SE 7 is grounds for speculation also, while Ted predicts the rise of functional languages, Kirk's predicting a lame release, though Alex has a more optimistic view.

Over in the mobile space, more smartphones and app stores are an easy guess for 2009, a turning point for Java ME, but will a majority of connections to the internet be from a mobile device this year ?

Tuesday Dec 23, 2008

Catching up on Java ME, Java SE, JavaFX

In taking a week off, the Planetarium has lots to catch you up on !

JavaFX has already issued Update 1, mostly with media playback improvements, like progressive download. The Janitor was podcasting with Cote after the launch, and JavaFX found a place on the cool wall at Devoxx. And its nice to see how many people are putting up their JavaFX apps on their blogs. And making new JavaFX tools, and running the SDK on Linux, even as the JavaFX team works on the production version. So is JavaFX itself an amazing Java application ?

In Java SE-land, there's new buzz over what additions to the Java language to put in JDK 7, with votes from Devoxx and JavaEdge. Joe Darcy put up a list of guiding criteria. Meanwhile there is an early access version of the 64bit browser plugin (high on the request list for too long) for the JRE as part of the upcoming Java SE 6 Update 12. And news of some really interesting optimizations of Java SE on the AMD chipset to get the best out of its multiple-cores.

Meanwhile, a new Java ME project has popped up, literally ! Either as a MIDlet or popping up as your phone's idle screen, the Java ME On Device Portal (ODP) offers a slick way to get new Java ME apps, like Flickr clients or weather apps, onto your users' phones. Whatever the backend app store. Another reason (see TS-15) to come to the MM3D conference in the new year.

Back in 2009 !

Thursday Dec 11, 2008

From Devoxx: JavaFX on show, JDK 7 News !

Closing out a busy week here at Devoxx, the release of JavaFX and JDK 7 news have been the talk of the town !

Kicking off the official conference part of Devoxx, your very own Janitor gave the first keynote (slides here) counting down the top 10 things about JavaFX you need to know. JavaFX team-Devoxx: Richard, Martin, Josh and Jasper showed four JavaFX applications, built with the 1.0 release. Like, JavaFX HD video apps (like this one), a JavaFX media cabinet shown on a popular Java ME phone. And wowed the crowd by using JavaFX to bring the huge movie screen size static backdrop on the stage to life with a beautiful Devoxx-themed animated design created in Photoshop and Illustrator and exported into NetBeans with the JavaFX Production Suite. Reactions to seeing JavaFX 1.0 for the first time have been very good.

Meanwhile, Devoxx attendees have been busily expressing their wants and needs on the whiteboards between sessions. Questions like Which language ?, Thinking of JavaFX ?, Which VM ?, Which JDK 7 language feature ? and even  Worst Blog ? attracted attention all week.

The next day, Josh gave an entertaining talk about the next generation Java puzzlers, followed by Mark Reinhold who keynoted on Java Modularity and JDK 7. As you read here on the Planetarium, Project Jigsaw will modularize the JDK, you will get a new low pause garbage collector, better performance, language changes (see Joe's blog), and there will be new APIs too: NIO2, Swing App Framework, Annotations on Java types and a host of smaller features like the XRender graphics pipeline, SCTP support, unicode 5 and so on. JDK 7 will preview at JavaOne 2009 (don't forget to file a talk) and ship in a little over a year's time.

Sessions galore. Like Alex and Brian on the work in the VM to support multiple languages, and Richard and Josh on JavaFX in Practice: with a surprising number of questions about developing JavaFX on mobile. Hanging with half the JavaPosse off mike (though they have been broadcasting all week), Belgian beer, twittering, bumping into old friends, a Devoxx movie and suddenly today is the last day. What a week !

The Planetarium will be taking a break for the next week, but back right before the holidays with more news about what's been going on in the world of Java SE, Java ME, JavaFX and JavaCard (which, by the way, all Belgians have at least one of).

A blog all about Java in all its flavors on all client platforms from smartcards to desktops and everything inbetween.


« July 2016