dagblog.
← Archive

Auto-Install — Another step toward usable desktop Java


The big problem with desktop Java is that the client computer has to have a JRE installed already. A second problem is distributing and managing the application, including checking for the required JRE version or updating the application when a newer version is available. Java 5.0 addressed that second problem with Java Web Start. It looks as though Sun’s engineers also found a possible and rather interesting workaround for the first one.

It uses a browser, a little JavaScript, ActiveX for IE only, and of course Java Web Start. In short, the user goes to a web page that does the following.

  1. Detects whether there’s a JRE on the system
  2. If there is, checks its version
  3. If there isn’t a JRE or it’s the wrong version, starts installing the required one
  4. After installing the JRE, launches the application through Java Web Start

The diagram below and its description show this in more detail.

↗ Medium

(Linked from http://java.sun.com/developer/technicalArticles/JavaLP/javawebstart/AutoInstall.html)

  1. The page loads and detects the browser type
  2. The browser is Internet Explorer on Windows
  3. The Auto-Install ActiveX component starts and may ask for confirmation
  4. It detects the JRE and its version
  5. If necessary, it installs the required JRE version
  6. It starts the application through JNLP
  7. Another browser
  8. JavaScript detects the JRE and its version
  9. If necessary, it opens a new window with the online JRE installer
  10. It loops until the JRE is installed
  11. It starts the application through JNLP

The full description and source code are on the Sun Developer Network in Auto-Install: Easier Launching of Java Web Start Applications.

A final word. I’ve deliberately called it a workaround because it has several weak points. First, IE has to have ActiveX support enabled and allow it to run, which may not be true for every user. Another drawback, leaving disabled JavaScript aside, is that installing the JRE in other browsers requires user interaction. Still, it’s better than a poke in the eye.

I’d be interested to know how you like this approach.

Medium version

Related articles

Related CZ Podcast episodes