The Planetarium

           Java for all clients: Java SE, Java ME, JavaFX and JavaCard

New API for Constraint Programming

Filed under: java javase on Wednesday Aug 19, 2009

Constraint programming is a kind of declarative programming. Specifically, where you say what conditions constitute the solution of problem, rather than the laying out steps or algorithms by which you get to it. Deng Xiaoping had a saying for it. A bit like assessing weather conditions for sailing, or evaluating economic indicators when deciding central bank policy, these conditions come in the form of restrictions on the interrelationships of a carefully selected set of variables which model the computing problem.

There are various Java libraries to help write applications that use this idiom, like Choco, or Constrainer, to name but two, and there's growing interest in this style of computing.

So it was good to see yesterday the JCP give the go ahead to develop a standard Java API for constraint programming.

You almost certainly heard that you can drag an applet out of its web page, so long as the version of Java running it is current enough.

But did you know that you can change the applet as it's being dragged out, or put back in ? That you can change the appearance of the applet according to whether the version of Java running it supports the draggable feature ? That you don't have to have the users hold down the alt key to drag it out ?

If you didn't, check out this tech tip from Javafx.com.

In a physical store, the attractiveness of the shelf display masks what is usually a highly complex set of processes by which the products arrive on the shelves. How optimized these processes are can make or break a store.

Peeking into the backend Warehouse of the Java Store, Bernard Traversant walks you through the process by which Java and JavaFX developers can submit their apps. From attaching all sorts of descriptive information about the application that the store will need (like export licenses, platform version) or that the shelf display will need (description of the application, icons, and, ultimately, the price you set) to the requirement of packaging the application as a single JAR (which NetBeans 6.7.1 handily meets) its all covered here.

For anyone interested in using the JVM to run a language other than Java, and even for those interested in how it runs the Java language, and definitely those interested in language development, the annual JVM Language Summit held in September has become the primary place to be.

You get the idea by taking a look at some of the talks from last years summit: From Clojure, PHP on the JVM, the vicissitudes of running Ruby on the JVM, to Closures on the JVM. And you will also see that you will be hard pressed to find more expert speakers in these subject areas in the industry.

And this year the format has changed to include more interactive workshops, as well as the traditional talks, to spread the goodness even more effectively.

If you're hesitating: stop it: John likes to keep this summit small and focussed, usually under 100 participants. Sign up here.

JDK 7: Jigsaw and classpath

Filed under: java jdk jdk7 on Thursday Jul 23, 2009

Developers have sometimes had to try to square the circle with the Java classpath over the years. What really is a linear model in multiple sections works for much of the time. But as applications get larger, and the dependencies between it and the libraries it needs get more complex, things break down.

Luckily, Project Jigsaw will be providing a cleaner dependency model in JDK 7 to save developers from trying to prove the impossible.

In the meantime, Joe posted a great visual summary of the three sections of the Java classpath.

Scala Lifting Off ?

Filed under: java jdk multilanguage on Friday Jul 10, 2009

If you are think about adding a new language to your programming language history, then you are probably following the recent discussions about whether Scala will replace the Java language, summarized here at InfoQ and with a followup from James 'Groovy' Strachan here.

Scala is an object oriented and functional language, like many other JVM languages. Yet unlike many of today's JVM langauges is statically typed. It's been implemented on other platforms (.NET, Android) but still primarily appears to be used on the Java SE 6 VMs. It's been through a couple iterations since its first release in late 2003, and although typically Scala programs use the underlying Java APIs, frameworks are starting to appear for Scala, most notably, Lift, for web app development.

And NetBeans seems to be ahead of the curve in its support for Scala.

A nice way to see if you agree it could replace Java one day.

Garbage First 'quite zippy'

Filed under: java javase jdk7 on Wednesday Jul 01, 2009

You've probably been told over the years how great JVMs are. How well they've scaled, perform under a variety of different loads. How its doing its part to take advantage of the processing power of multi-core systems now that cranking the clock rate is almost wrung dry.

The automatic memory management provided by the JVM's garbage collector is one of the most important aspects of scaling the JVM. There are many different kinds - as this great primer shows.

The new (free) Hotspot Garbage First collector in beta form for evaluation in Java SE 6u14, and which will ship production quality in JDK 7 is summarized succinctly here, and you can find a more detail here about this generational, compacting, mostly parallel collector that offers a much smoother ride that the CMS collector will replace.

And some early signs of use are encouraging !

Java ME Defragmentation

Filed under: java javame on Monday Jun 29, 2009

For those of you concerned about Java ME fragmentation, you were probably pleased about the creation of JATAF - a group of mobile companies (and Sun) getting together to try to sort out the issues of differences in implementation, quality, and performance that even the best API specs can't always iron out.

Such organizations often flirt with an excess of hot air, but happily, this organization is taking a practical approach - by basing their efforts around collecting up a big set of tests that plug into a test framework that originated in a Sun testing product called JDTS for mobile devices that can run its 12,000 or so tests on Java ME mobile devices and that's been around for quite some time. Such tests assume API compatibility, which is what the JCP requires, taking testing to a deeper level by probing the other implementation qualities such as reliability and performance.

One step that made this possible was the open sourcing of the test framework, the Java Device Testing Framework from the Sun product. So now folks can sign up to JATAF and submit tests into the framework for all to use. There's over 70 already. You can read more at Terrence's blog, or listen in to the latest Java Mobility Podcast.

JDK 7: Collecting Honey

Filed under: java javase jdk7 on Wednesday Jun 17, 2009

There's also been a flurry of blogging and articles around the JDK 7 Preview, released at JavaOne, too.

Like about Project Jigsaw, which will modularize the JDK. Most of the audience got it when Mark announced that Classpath is Dead, but for a deeper dive, check out this JavaPosse episode, where both Mark and Alex got a grilling.

Or about the multi-language VM work, which John presented. And Charlie has used already in an experimental version of JRuby. And bytecode manipulation framework ASM has already picked up. Who's next ?

Project Coin, which is gathering a small set of additions to the Java language for JDK 7 is narrowing down the many options, as you can see from Joe's slides.

Take a look at this detailed article about NIO2, also in the JDK 7 Preview, and which Alan presented on.

And thankfully the is-the-G1-collector-free-or-not storm in a teacup blew itself out.

Is it hump day already ? Day two: all about smaller devices !

More App Stores

The day started out with a keynote by Sony-Ericsson, who, guess what, are opening an app store for Java ME apps ! Together with the previous day's announcement from Verizon opening up their application developer model to Java ME, and of course Sun's new Java Store, the Planetarium's prediction that this is the year of the app store, really is coming true !

JavaFX Mobile 1.2

JavaFX Mobile developers are getting that performance boost as part of the JavaFX 1.2 release (20% in runtime perf, about 1/3 reduction in compiler output). And of course all the other goodies like the cross device UI controls.

Eric showed great new JavaFX apps at the Sun Mobility keynote: ReallyMe for social proximity, and PayPal (pictured) for mobile payments.

JavaFX Mobile Phones

Sony-Ericsson wrote a Twitter client (perhaps not as good as this one) live in their keynote and deployed it to three of their JavaFX phones, including those running WindowsMobile and SymbianOS). Best of all, JavaFX Mobile 1.2 phones are on sale at JavaOne, some even got hurled at the Mobility Keynote.

Java ME

The testing framework Java Verified goes into open source, and plays a central role in the new anti-fragmentation initiative JATAF (behind which Orange and Vodafone threw their support today), Java ME 3.0 SDK running on a MAC is on show at Java Utopia, and the recent PhoneMe milestone 4 release.

And in preview for the end of the year....

JavaFX (running on embedded Java SE on Linux) seen running on a new Qualcomm smartbook, the JavaFX TV platform running on the LG TV.
Filed under: java javafx jdk7 on Tuesday May 26, 2009

The Janitor isn't one to fall prey to the latest trends, but there's one trend that this week will follow: there won't be much news this week about Java SE, Java ME, JavaFX or JavaCard before the start of JavaOne next week.

But if you go by what people are searching for, its easy to see the cyclical nature of the interest in the JavaOne show, where many of the companies involved in Java save up their technology announcements. And you can clearly see the growing interest in JavaFX since May 2007 when it was announced, in JDK 7 since the release of Java SE 6 in December 2006, continued interest in Java TV (stay tuned), and in Java updates. Even Project Vector is showing an interesting recent spike.

And in a trend few would have predicted for JavaOne in 2001, Microsoft will be giving a keynote (about interoperability with .NET).

GR8 time in Copenhagen

Filed under: java jdk on Friday May 22, 2009

This helpful article about how the Groovy language plugs into Java SE 6, together with a nice code example of how to execute arbitrary Groovy code, came at the end of the first GR8 conference in wonderful, wonderful Copenhagen.

The talk about the Griffon hatchling looked interesting. To get an idea of where this framework that combines Groovy with Swing,  is at here's a Twitter client in Griffon. Guillaume's DSL talk was reviewed in detail, and there was lots of twittering.

Maybe there will be another next year ?

You'll see in the latest JDK 7 build that the new G1 collector is getting a good bashing, with a number of important bugs fixed.

The preview implementation of JSR 292 is in, and the rumors that reached the all hearing Planetarium ears turned out to be true: Charlie's trying it out in JRuby, and so's Frank with Jython.

So together with compressed object pointers, NIO 2 (which Alan has been blogging about at length - from the new filesystem API, to monitoring direct buffers), an important tweak to the classloader, SDP API and Solaris implementation, and SCTP support, which Chris blogs about today at length, things are in great shape for Milestone 3, which will be released at JavaOne.

Inside the walls of the Planetarium you can gauge people's stress levels quite easily: Are they counting off the days until JavaOne begins, or the number of days until it ends ?

Of course all the sessions are online now, and you should be signing up because some of them are already full. And of course, students get a free pass. And of course who will the special guests will be, in this, the year of the app store ?

Alex Miller posted a nice list of JDK 7 / Java SE 7 talks, and Terrence posted a comprehensive preview of mobility related activities. There's a bunch of JavaFX stuff going on (so much more to say this year), like Jim's panel session, and many, many others.

Hope to see you there !

One of the exciting things going on today in the technlogy industry is the proliferation of new computing languages. Another is that the JVM is evolving to run most of them really, really well. Most exciting is how the ideas between the languages are being begged, borrowed and stolen, to the ultimate benefit of developers writing all kinds of applications. The Planetarium has long been a subscriber of the Darwinian notion that diversity spurs innovation.

So it was interesting to see that Sun's own John Rose was at the Lang.NET symposium up in Redmond last month, talking about JSR 292, which you can watch here*, and giving an interview, which you can watch here*, about the new work to turbo-charge multiple languages for JDK 7.

And, no doubt, participating in the sharing and borrowing of good ideas with the other attendees.

Frank Wierbicki, Dr Jython, was there too, talking about Jython on the JVM. And there was a crazy rumor that Charlie hacked up an experimental version of the JRuby compiler over the weekend to use JSR 292's invokedynamic bytecode, coming to the JDK 7 builds real soon. Maybe there will be more from Charlie at JavaOne.

* You'll be asked to install Silverlight to see these vids. Just sayin.