2010-03-01

Is it time for a JVM-based web browser?

Figure 1: Screen shot of JWebPane in action (source).

There are currently two exciting platforms for which one can develop:
  • The Java Virtual Machine (JVM). Advantages: Great tools, hosts many languages, lots of free software is available for it (databases, support for many file formats, etc.), supports modularity (OSGi, Jigsaw).
  • The web browser. Advantages: One can quickly try out an application without downloading anything, URLs encode application states and are bookmarkable, the ability to clone application states via tabs, integrates hypermedia and data streams of all kinds.
Then how about combining these two platforms? It seems like a missed opportunity for the JVM that all major browsers now have JITs for JavaScript, but none of them uses the JVM. What would a JVM-based web browser look like?
It would be modular, every aspect of it would be extensible in Java. It would be host to a new kind of web/desktop application hybrid. If the JWebPane technique of porting Webkit to Java2D really works, then it can even provide a perfect web experience (Fig 1, 2). Alas, it has been a long while since there was any news about JWebPane.

Figure 2: JWebPane is a port of Webkit to the JVM (source).

I do realize that applets go a long way in the direction of this vision, but several minor details add up so that one still feels the barrier between Java and the browser. I could never get excited about JavaFX, it always felt like Java was trying to be like Flash. But the idea of a JVM-based web browser, HotJava 2 if you will, does excite me in ways I cannot all explain rationally. I can see myself extending such a browser with many tools and writing all my future applications based on it.

Update 2010-03-02: See my comment below on a refinement of these ideas.
Update 2010-12-15: Oracle has granted my wish and turned JavaFX from a language into a library.

2 comments:

Dominique De Vito said...

I wrote in April 2009, HotJava may come back, due to existing, or coming, components, like JWebPane:
"While time may come true a false advertisement, it could help HotJava's comeback. Remember HotJava !? Yes, the web browser implemented in Java. I don't know exactly if HotJava is going to come back, but the different pieces are there, existing in a better shape than before. So, let's take a look at different pieces that could be part of a new HotJava release, or that could make it a valuable browser..."

Well, the programming model for such a Java browser is already there: it's GWT. I wrote about it in Google has released a (kind of) Java Browser Edition with GWT:
"Few years ago, I wrote Why not running a Java Browser Edition on top of Firefox VM (Tamarin) ? after reading a post of Ethan Nicholas (SUN) about a forecasted Java 2 Browser Edition (renamed later as Java Kernel).

AFAIK, such edition has never taken off. But I realized recently it lives under another form, quite according to my initial post's wishes; more and more pieces of a browser edition of Java run on top of JS engines, inside browsers, with the help , for example, of the GWT Java to JavaScript compiler.
"

And GWT is a good way to go due to the fact GWT and Jetpack are going to shake up the web-based (RIA) desktop application landscape.



But, unfortunately, the worst news is that SUN has missed a very important opportunity for JWebPane as I wrote in XML-based GUI programming is rising, but don't forget CSS too:
"I wrote into my post HotJava may come back, due to existing, or coming, components, like JWebPane there was an opportunity to revivify a Java-based browser, that is a Java-based client-side platform, following Adobe which is providing a platform with Adobe AIR.

According to JavaOne slides (see my post above), JWebPane looks very promising; the bad news is that JWebPane was announced a long, long time ago (since mid-2008 or even earlier), and looks like to live in limbo as nothing has been released (even if promised for the end of 2009).

SUN has missed a very important opportunity with JWebPane (I am not the only one who think that, read here). JWebPane summarizes important SUN’s past drawbacks with bad and huge consequences unfortunately: development behind the door only, lack of news, failure to deliver on time important pieces of code... GUI with Java would have been changed with JWebPane being delivered 1 year ago...
"

Oracle could still revivify JWebPane to build a Java-based Adobe AIR competitor, but SUN/Oracle has lost a lot of time...

Axel Rauschmayer said...

I agree. What I am missing from Sun/Oracle is an exciting vision for Java’s future. I find GWT exciting, but never fully understood what the point of JavaFX was. To compete with Flash? Why can’t Java do that? GWT will never be able to translate all of the JVM platform to a browser, thus there is currently one missing piece in this puzzle: How to install the server functionality locally. Something like Java Web Start would be nice here. JWebPane could help with packaging a GWT application for the desktop.

Web Analytics