Java News from Tuesday, May 8, 2007

Tuesday kicks off with a keynote at 8:30 A.M. PDT. If the wireless permits (and it may not) I'll live update this site. Likely announcements include a GPL'd J2SE and a Flash/AJAX competitor. (I have no expectation that Sun can do this right given their lack of talent on the desktop, but I do expect they'll announce something anyway.)

MacWorld this isn't. The only line outside the door is for press, and it's not a long one. The hall is much larger than the audience.

Hmm, looks like the wireless in the keynote room is just as bad as it was yesterday so no live updates. I'm not sure whether to blame the network or my TiBook.


Random sites shown during the intro slideshow:

I'm not sure if there's any significance to these choices. Most of them are shown in Safari. There's a lot of Flash content. OK. Show's over. Apparently they meant nothing.


John Gage discusses the effort to make the conference carbon neutral. They did not succeed this year because it was too hard to measure all carbon sources associated with the conference. They'll try again next year. You can buy carbon offsets at $3.75 a ton, but Gage thinks this is off. the real number may be as high as $100 a ton. They are definitely thinking about electricity budgets of devices, including phones. They want to run devices off the grid. Today, with Solio, they can get 10 minutes of talk time on a phone per one hour of solar charging. "Our holdup forever has been the battery."


There were three big announcements during the keynote:


The JDK is now released under the GPL v2. I couldn't find it on the web site, but I didn't have long to look. It's probably there somewhere. (Found it.) Later in the day, Danny Coward revealed that this was an overstatement. A couple of pieces of the JDK from third parties are not GPL yet. They are only available as binary plugs. Sun is negotiating with the owners to GPL them.

There's an interim governing board consisting of Simon Phipps, Dalibor Topic, Mark Reinhold, Doug Lea, and Fabian Nardon. They'll write a constitution and hold elections. There's a special NetBeans module for contributing to the JDK. The TCK will eventually be made available. If a product passes the TCK, it can use the Java brand.


JavaFX Script is a Flash competitor based on Java. Sun flubbed this one pretty badly. Sun knows languages, and they built a language; but they don't need a new language. They need better development tools. JavaFX Script is not accessible to your typical Flash developer. They advertised that the designer of the language was able to build a site using this in only 3 days by copying an existing Flash site. They bragged that this was much faster than doing this in pure Java. However I'd estimate it takes about three times as long as doing the same site in Flash. Sun promises actual tools in the not too distant future.

The language is not Java. For instance, there are no semicolons at the ends of lines. However it runs on a VM. I'll have more to say about that this afternoon after Bob Bruin's session devoted just to this.

Also, what brainiac thought JavaFX Script was a good name? Like we don't already have enough trouble distinguishing Java and JavaScript? Now we have to explain JavaFX Script too? Please, please, please rename this before it's too late. I hear "LiveScript" may be available. :-)


JavaFX mobile is essentially Java SE 6 in a phone. It's based on the Savaje acquisition. The kernel is Linux. (Maybe Solaris if it can be ported to ARM.) Sun provides the software to OEMs. They will not sell phones and PDAs directly to consumers. (Smart.) It's pure virtual screen in the demo hardware, no keypad. This could be important. I still don't think we've seen the real portable device that will change the world, but we may be on the road to it.


Overall I give the keynote a B-. There was some real news but not enough to justify two hours. Sun could have said everything they said in an hour and still had twice as much fluff as actual content. I don't know why the standard parade of VPs from other companies. None had anything interesting or important to say. I'm not sure if Sun gets to feel important by having these suits get up on stage with them or the suits get to feel important by participating in the JavaOne keynote. Either way it's waste of our time. At least the guy from the U.N. knew how to talk to an audience which is more than I can say for any of the other "special guests".


The first session of the morning is Danny Coward on Java SE: present and Future. The badge checks are keeping about a quarter of the audience out of the room as the session starts. There's just not enough time between sessions to push everyone through past just four badge scanners.

Java 7 is scheduled for final release in December 2008, maybe the start of 2009.

I am so sick of presenters who claim download numbers mean anything. They did it in the keynote. Coward is doing it now. He says there are 2,000,000 downloads of the JDK 6 and this means one third of Java developers have upgraded. The problem is that I've downloaded it several times myself, maybe as many as 10 or 12 times for different systems and reasons.

He says it's time to upgrade to Java 6. What a crock. Just throw away every Mac on the planet at one stroke. That's a great way to please your customers. There are some nice features in Java 6, but nothing that's worth ignoring the majority of the installed base that doesn't have java 6 and doesn't want it. Maybe once Java 7 comes out we can start thinking about moving to Java 6. Personally I'm just starting to digest Java 5.

Java 6 adds jhat to analyze memory usage, jmap to snapshot memory usage. These probes can be dynamically attached to do diagnostic activities in the field.

A couple of pieces of the JDK from third parties are not GPL yet! They are available as binary plugs. Sun is negotiating with the owners to GPL them. API changes will continue to go through the JCP.

Expect a "Consumer JRE" release in late 2007/early 2008. This will have a much faster cold start the first time you load an applet. The trick is loading files into the disk cache. This is not the same as having a running VM in terms of memory usage. Sun is also doing user experience work to improve the installation of the JRE. Finally, they are working on Java kernel, a modular JRE. A custom JRE can be created for applications that can't be paused to wait for classes to load. Many GUI apps such as LimeWire now run in about a third of the total memory needed to load the whole JRE.


I got a few more details on what is encumbered and what will be released under the GPL from Tom Marble. Encumbered pieces include:

We'll need to explore the JDK to find out exactly what classes those are. They probably will not be able to released under the JDK, ever. They will have to be replaced. There nay be some patent issues in the way as well, especially around the font rasterizer. (Anyone happen to know what those patents are likely to be?)


Bob Brewin delivers the technical keynote on the subject of JavaFX Script, or at least that's what we were promised. Instead we seem to be getting a rehash of Danny Coward's Java SE 6 presentation from this morning.

Jerome Dochez is talking about Glassfish 3. Goal is less than 100K for the kernel, half second startup time.

Patrick Hogan of NASA discusses World Wind, an open source version of Google Earth written in Java. The data does not appear to be open though.

Kenneth Russell demoes IRIS online photo editing. The demo Mac crashed. They're using Windows now.

JavaFXScript:

This is quite complex stuff, at least as hard as writing SVG by hand. Live preview helps. It does apear to be simpler than straight Java or JavaScript.


In the next regular session Joshua Marinacci and Hans Muller present the Swing Application Framework. Features include:

Application is a singleton. This will make automated testing and unit testing hard.

Hello World is appropriately simple. It's based on SingleFrameApplication extends Application. More Application subclasses to come.

Lifecycle like an applet's:

ExitListeners can veto shutdowns.

Even running and developed on a Mac, the applications don't look very native.

Application resources are defined with resource bundles. Can store strings, colors, and fonts. ResourceMap is a chained resource bundle. Fields can be initialized from resources, though this requires Java 7. You can build resource maps from existing components and containers. This is called injection. I still don't think it's as powerful as ResEdit was 20 years ago.

Annotations can be used to define a method as an action. This feature I don't like at first glance. We already allow inner classes and may soon allow closures. Yet another approach is a little confusing and unnecessarily duplicative. Action properties can be set from a resource map.

Task is a SwingWorker is a Future. Futures compute a value on a thread. They can be cancelled or interrupted. SwingWorker is in Java 6. Tasks just add a little more, mostly messages and monitoring. They change how SwingWorker completion works. There are separate failed(), interrupted(), cancelled(), succeeded(), and finished() methods you override to do work at the completion of a task.

Tasks can block the GUI for input (not the same as freezing the GUI). I.e. you can make modal dialogs. This is done with a blocking scope property.

Tasks are executed by a TaskService that can be serial, thread pooled, parallel, etc. This is an ExecutorService.

TaskMonitor summarizes what's going on in the background. This is useful for status bars, among other things.

Netbeans has very good support for this framework, despite a few bugs.

Session state remembers where you left things. (GUI widgets states and such.) This is done with JavaBeans XML persistence.

Overall this framework looks like a good idea to me, despite a few minor quibbles. This was also the most technical, code-heavy and interesting presentation I've seen yet.


The next session is about improving the install process for Java. It looks good, but there's still an obnoxious license agreement. It's just more hidden. This is definitely something that should be forked. There should be a JRE that does not ask the user to agree to anything, just like all good GPL software.

The new installer will patch in place so you don't have an explosion of JREs. Smaller updates will download faster.

Java Deployment Toolkit, a suite of three tools for detecting and deploying Java code

JavaScript for detection
  • getJREs
  • versionCheck(pattern)
  • installLatestJRE()
  • writeAppletTag(attributes, parameters)
  • runApplet(attributes, parameters)
  • isWebStartInstalled()
  • createWebStartLaunchButton(jnlpURL)
<script src="http://.../delpoyJava.js"/>

<script>
deployJava.runApplet(...)
</script>

This is not seamless but it is better.

Optional browser plug-ins work in concert with the deployment JavaScript.

getjava.exe
For standalone applications outside the browser. Detects installed version of Java and installs a newer one if necessary. This is only for Windows.
Java QuickStart

A service that improves cold start by loading VM into disk cache. Warm start is 0.1 seconds if the data is already in memory. Need to improve cold start performance. Loading VM at startup as Office and Acrobat do eats real memory and eventually leads to disk swapping. Touch all files to load them into the disk cache. This doesn't work on low memory systems, but it doesn't hurt; and it does improve matters in most cases.

The second announcement is the Java Kernel, a smaller, stripped down library that loads extra classes dynamically at runtime from the network. Most programs use less than half the Java APIs. However it's always a different half. Nothing can be deleted.

Sounds good. This should all make applets much easier to deploy. Now if only there were some decent tools for writing applets like there are for Flash and (increasingly) AJAX.


The next session is about JSR 311, RESTful Web Services for Java. Developers prefer to consume REST services to SOAP, given the choice. However the Java HTTP APIs are low level. Can we fix this? (That's their thoughts. Mine are that this is a feature, not a bug.) Seems like mostly server side. They want to use annotations instead of servlet logic and URI templates instead of web.xml. What we really need here is a better HTTP API. Maybe this is it. I'm not sure.

They're looking for RAILS like tool support that automatically generates RESTful APIs from a database that exposes CRUD operations.

They want to generate clients (maybe mostly for testing) from the server side annotations too. This involves WADL.


At the first BoF, I got a direct answer to the question of whether Sun would come after me for using the word "Java" in the context of package names such as java.lang and java.util in an incompatible fork of the JDK. The short answer:

No


I spent a little time in Neal Gafter's Closures BoF, but mostly he just reiterated the same slide deck that didn't convince me the first two times I saw it, and that he'll probably go over again on Friday. I was tired so I left early. There may well be a case to be made for closures, but so far Neal isn't making it. He hadn't planned to reuse the same slides again last night, but half the audience wasn't familiar with his proposal. Still, it would have made more sense to let the first couple of questions be "What's a closure?" and "Why does Java need closures?" and then answer them spontaneously rather than reiterating the same talk he's giving twice more at this conference, and that has been widely disseminated on the Internet previously.