Apparently, JRE 1.4.2 is not quite ready for use with Java Web Start. I spent a lot of wasted hours last week trying to accomplish what should have been an easy task.
- Create a simple HTML start page. This page should detect if the user has JWS installed. If not, it should direct them to an auto-download site.
- Configure my JNLP file to say “1.4.2″ as the version number. Again, JWS should auto-download the correct JRE if it is not already installed.
Creating the HTML web page should be easy. Sun even provides little scripting examples in this document. I followed their instructions but it kept failing. Oops…turns out their code has a bug:
If Not(IsObject( CreateObject("JavaWebStart.isInstalled.3"))) Then javaws142Installed = 0
That little snippet is supposed to detect if version 1.4.2 of JWS is already installed. It did not work…after some investigation into the registry, I determined the correct variable should be
JavaWebStart.isInstalled.126.96.36.199. Now that my script could detect if JWS was installed, it tried to download the JRE.
Well, the URL to auto-download JRE 1.4.2 was broken all week. I checked it again as I started writing this BLOG, and it seems to work, although 1.4.2 is not listed in the list of supported JREs. Hopefully they have this problem fixed.
Broken Dialog Box
After two days of fiddling, we gave up on automatically downloading the JRE. Now when we start our app, however, we get this stupid JWS dialog box that locks users out of our app. It is a modal dialog that gets buried beneath our own login dialog, so users cannot do anything until they Alt-Tab to cycle through windows and un-bury the JWS dialog. This is documented in Bug 4845341 on Sun’s Bug Parade. So I spent half a day writing an incredibly ugly hack to bypass the problem. In my hack, we start a thread that continually searches for the JWS dialog and forces it to the front occasionally.
The final annoyance is the fact that the JWS Desktop Integration Dialog mentioned above has a spelling error! (apologies if my BLOG has spelling errors…I don’t have a spellchecker) This makes our own app look stupid and amateur. I submitted this as yet another bug to Sun…it has not shown up yet so I cannot report the bug ID here.
Is Java Web Start Important to Sun?
I don’t think Sun has put in enough effort to make JWS as great as it could be. It should be EFFORTLESS to install. I should be able to paste in some sample HTML for my starting page and that HTML should actually WORK. I should be able to specify JRE 1.4.2 in my JNLP file and it should download onto user’s PCs AUTOMATICALLY.
This is a big pain in the butt right now. The potential for Java Web Start is tremendous, and all Sun has to do is iron out a few wrinkles in their implementation. But sorry, Sun, 95% completion is not good enough when it comes to deployment and installation of desktop applications. These things need to be 100% reliable and simple enough for a beginner to configure. I wasted way too much time tracking down problems that should not be there. I could go on and on, but I think I’ve made my point.
Make it work.
Make it simple.
Make it reliable.
Wouldn’t it be great if Sun’s JWS implementation was open source so we could go in and fix these bugs? Or if perhaps someone hosted an auto-download server somewhere that actually worked? I’m sure lots of companies would pay a nominal fee for such a service.